Jib.js
A lightweight javascript run-time environment, with node.js compatiblity in mind
Install / Use
/learn @eduardsui/Jib.jsREADME
jib.js
Jib.js is a lightweight javascript run-time environment, designed to be easily embedded into other applications. It uses mostly standard C functions and some POSIX functions.
Its objectives are:
- small footprint
- easily embeddable
- portable
- no dependecies
- node.js compatiblity
- to be usable as a shell interpreter
It may store all .js modules inside the library/executable (see src/modules.h), external I/O being optional.
It currently supports: fs, net, tls, crypto, path, http, https, url, querystringify, events and Promises.
jib.js uses duktape(default) or quickjs as interpreter.
Compiling
Linux & BSD:
$ ./build_unix.sh
Windows:
build_win32.bat
macOS:
$ ./build_macOS.sh
esp32:
$ cd esp32
$ idf.py build
Examples
Run a simple web server on localhost on port 8080:
$ ./jib examples/server.js
Simple hello world (from node.js website):
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer(function(req, res) {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
server.listen(port, hostname, function() {
console.log(`Server running at http://${hostname}:${port}/`);
});
It also supports streams:
// ...
var readStream = fs.createReadStream("." + pathname);
readStream.on('open', function () {
readStream.pipe(res);
});
readStream.on('error', function(err) {
res.statusCode = 404;
res.end(err.toString());
});
// ...
License
Where not specified public domain applies. Some sources from third parties are under BSD, MIT or Apache.
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
