b4n1-boost
v0.4.1
Published
Native accelerator for Node.js & Express: SIMD compression, fast JSON, background tasks without Redis
Maintainers
Readme
b4n1-boost for Node.js
The Native Accelerator. One core engine with SDKs for Python, Node.js, .NET and Java — JSON 10x faster, compression 28x faster. BSL-1.1 (native binary under EULA.txt).
Install
npm install b4n1-boost| Platform | Status | |---|---| | linux-x64, linux-arm64 | native included | | macos-x64, macos-arm64 | native included | | windows-x64 | native included | | others | pure-JS fallback (slower, same API) |
Use
const B4N1Boost = require('b4n1-boost');
// Compression / validation / minify (native when available)
const gz = B4N1Boost.compressGzip(Buffer.from('hello'.repeat(1000)));
const ok = B4N1Boost.isJsonValid('{"a":1}');
const min = B4N1Boost.minifyHtml('<p> hi </p>');Background tasks (no Redis, no BullMQ)
const { background, pendingTasks } = require('b4n1-boost/background');
// Returns immediately (~ms); heavy work runs in a worker thread.
// Every submission is journaled to disk: a restart never loses a record.
const sendReport = background(async (userId) => {
/* ...build PDF, send email... */
return `report-${userId}`;
}, { journal: './b4n1-tasks.jsonl' });
const handle = sendReport(42);
const result = await handle; // wait when you need it
console.log(pendingTasks('./b4n1-tasks.jsonl')); // crash recovery: re-run theseWorks with Express out of the box:
const express = require('express');
require('b4n1-boost/express');Test
npm test # 4-state matrix, must be 4/4 green