solijs

2.6.2 • Public • Published

solijs

npm version GitHub release License Issues Build Status

solijs is a prebuilt native Node.js module that links and interacts with Linux .so (shared object) files directly from JavaScript using the N-API interface.

This tool allows you to:

  • Run functions inside .so files (both void and int returning)
  • Capture their output (text or return values)
  • Inspect dynamic symbols defined inside the .so

Update Logs

Deprecated packges

  1. 1.8.0-prerelease — due to large size thr deps remove and add something better

  2. 2.4.0 — Corrupted packages(has a lot of errors)

Release packages

  1. 1.9.0-alpha — removes the deps folder(a big size folder)

  2. 2.0.0 — added new features such as outputting arrays, buffers and more!

  3. 2.3.1Now Suppport stdout prompting, and like chatbot!

  4. 2.4.5Binding gyp support are now release! Prebuilt is still supported.

  5. 2.5.6Added functions such as args and machine code output, enhances the system and fix bugs

  6. 2.6.2Supports Game Logics But with limit

updates coming soon!


Installation

1. Install the module

npm install sljs

The native node is precompiled in Pb dir


Usage

Load the module

const sljs = require('sljs');

runText(path, symbol)

Runs a void function from .so and captures stdout.

// C source example (text.c)
#include <stdio.h>
void say_hello() {
    printf("Hello from C shared object!\n");
}

Compile:

gcc -fPIC -shared -o libtext.so text.c

Call from JS:

const output = sljs.runText('./libtext.so', 'say_hello');
console.log(output); // "Hello from C shared object!"

runValue(path, symbol)

Runs an int-returning function and returns the result.

// C source example (value.c)
int give_number() {
    return 69420;
}

Compile:

gcc -fPIC -shared -o libvalue.so value.c

Call from JS:

const num = sljs.runValue('./libvalue.so', 'give_number');
console.log(num); // 69420

inspect(path)

Inspects available dynamic symbols from .so using nm.

const symbols = sljs.inspect('./libvalue.so');
console.log(symbols); // List of symbol lines (like from `nm -D`)

Use Cases

  • Custom algorithms written in C/C++ (like hashing or compression)
  • Wrapping performant native logic for JS access
  • Interfacing low-level Linux .so modules
  • Fast native extensions without recompiling every install

License

MIT
Author: Jeck Christopher Anog


Disclaimer

This module does not decompile .so files. It exposes and interacts with dynamic symbols using safe, flexible bindings.


Warning

DO NOT INSTALL ANY DEPRECATED PACKAGES AS IF DECLARED VULNERABLE TO ANY THREATS!


How to install prebuilt binaries

  1. Go to my Github Repository(Link in the bottom)

  2. Find the Pb folder

  3. After that download it raw and download all the files except binding.gyp

  4. test it and if it works, congrats u've install the npmjs package without thr node-gyp!

Note: The Prebuilt is only for device that doesn't support node-gyp.

Package Sidebar

Install

npm i solijs

Weekly Downloads

526

Version

2.6.2

License

MIT

Unpacked Size

601 kB

Total Files

39

Last publish

Collaborators

  • jeck_1224