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 (bothvoid
andint
returning) - Capture their output (text or return values)
- Inspect dynamic symbols defined inside the
.so
Deprecated packges
-
1.8.0-prerelease — due to large size thr deps remove and add something better
-
2.4.0 — Corrupted packages(has a lot of errors)
Release packages
-
1.9.0-alpha — removes the deps folder(a big size folder)
-
2.0.0 — added new features such as outputting arrays, buffers and more!
-
2.3.1 — Now Suppport stdout prompting, and like chatbot!
-
2.4.5 — Binding gyp support are now release! Prebuilt is still supported.
-
2.5.6 — Added functions such as args and machine code output, enhances the system and fix bugs
-
2.6.2 — Supports Game Logics But with limit
updates coming soon!
npm install sljs
The native
node
is precompiled in Pb dir
const sljs = require('sljs');
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!"
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
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`)
- 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
MIT
Author: Jeck Christopher Anog
This module does not decompile .so
files. It exposes and interacts with dynamic symbols using safe, flexible bindings.
DO NOT INSTALL ANY DEPRECATED PACKAGES AS IF DECLARED VULNERABLE TO ANY THREATS!
-
Go to my Github Repository(Link in the bottom)
-
Find the Pb folder
-
After that download it raw and download all the files except binding.gyp
-
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.