
Product
Introducing Data Exports
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.
brahma-firelight
Advanced tools
A blazing-fast, fire-and-forget orchestrator built with Rust and JavaScript, designed for ultra-low-latency task routing, message triggering, and heavyweight logic execution — all without blocking. A native Rust AddOn for NodeJS, BunJS and DenoJS.
Brahma-JS is an ultra-low-latency orchestrator for JS, blending familiar Express-style middleware and routing with a high-performance core built in Rust. Ideal for micro-service and API use-cases where speed matters.
Benchmarks were run with wrk on an Intel® Core™ i5-12450H (12 vCPUs available under virtualization, 200 concurrent connections, 10s duration):
wrk output (Brahma-JS):
Running 10s test @ [http://127.0.0.1:2000/hi](http://127.0.0.1:2000/hi)
1 threads and 200 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 1.51ms 479.16us 7.89ms 78.17%
Req/Sec 131.57k 9.13k 146.78k 79.00%
1309338 requests in 10.00s, 186.05MB read
Requests/sec: 130899.58
Transfer/sec: 18.60MB
Takeaway: Brahma-JS sustains 130k+ requests/sec with low latency, powered by its Rust core and Express-style developer API.
node server.js
# server listens on 0.0.0.0:2000
/hi endpoint:wrk http://127.0.0.1:2000/hi -d 10 -t 1 -c 200
-d 10 → run for 10 seconds-t 1 → 1 worker thread-c 200 → 200 concurrent connectionslscpu):Architecture: x86_64
CPU(s): 12
Model name: 12th Gen Intel(R) Core(TM) i5-12450H
Threads per core: 2
Cores per socket: 6
Virtualization: Microsoft Hyper-V (full)
npm install brahma-firelight
# or
yarn add brahma-firelight
# or
pnpm add brahma-firelight
# or
bun add brahma-firelight
# or
nypm add brahma-firelight
const {
createApp,
getJsResponseTimeout,
getMaxBodyBytes,
setJsResponseTimeout,
setMaxBodyBytes,
} = require("brahma-firelight");
const app = createApp();
// save production from disasters by locking in Rust
// defaults to 30 seconds and 4mb limit.
// set 2 minutes timeout (120 seconds)
setJsResponseTimeout(120);
// set max body to 50 MiB
setMaxBodyBytes(50 * 1024 * 1024); // 52_428_800
console.log("timeout secs:", getJsResponseTimeout()); // prints 120
console.log("max body bytes:", getMaxBodyBytes()); // prints 52428800
// CORS config
app.use((req, res, next) => {
const origin = req.headers.origin;
if (origin) {
res.setHeader("Access-Control-Allow-Origin", origin); // echo back client origin
res.setHeader("Access-Control-Allow-Credentials", "true");
} else {
// fallback (same-origin or no Origin header)
res.setHeader("Access-Control-Allow-Origin", "*");
}
res.setHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS");
res.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization");
if (req.method === "OPTIONS") {
res.send(204);
} else {
next();
}
});
// Middlewares
function authMiddleware(req, res, next) {
if (!req.headers["authorization"]) return res.text("Unauthorized", 401);
next();
}
// utils.js
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
app.get("/hi", (req, res) => {
res.json({ message: "Hello World from Brahma-JS!" });
});
// // Async handler returning an object
app.get("/time", async (req) => {
await sleep(20000);
return {
status: 400,
headers: { "Content-Type": "application/json" }, // Custom Returns
body: JSON.stringify({ now: Date.now() }),
};
});
// To send HTML response
app.get("/page", (req, res) => {
res.html(`<h1>Hello HTML</h1><p>Served by Brahma-JS id: ${req.reqId}</p>`);
});
app.post("/submit", (req, res) => {
let formData = JSON.parse(req.body);
console.log("bodyData:", formData);
res.json(formData, 201); // return the JSON response with http-status-code
});
// Set-Up cookies and User Sessions
app.get("/set-cookies", (req, res) => {
console.log("Request:-->", req); // Request Parameters-> contains all info + additional meta data
res.send(
200, // http-status code
{ "Content-Type": "text/plain" }, // headers Content-Type
["a=1; Path=/; HttpOnly", "b=2; Path=/; Secure; Max-Age=3600"], // manual cookie setup
"hello" // optional Return Body
);
});
app.get("/redirect", (req, res) => {
res.redirect("https://google.com");
});
app.post("/protected", authMiddleware, (req, res) =>
res.json({ success: true })
);
app.listen("0.0.0.0", 2000, () => {
console.log("Server listening on port 2000");
});
// Enable built in Graceful Shutdown (optional for production use)
// process.on('SIGINT', async () => {
// console.log('SIGINT → shutting down...');
// await app.close(5000); // wait up to 5s for requests
// process.exit(0);
// });
// process.on('SIGTERM', async () => {
// console.log('SIGTERM → shutting down...');
// await app.close(5000);
// process.exit(0);
// });
Just like Express:
app.get("/healthz", (req, res) => {
res.send(200);
});
But under the hood:
app.get("/data", async (req, res) => {
const result = await fetch(
"https://jsonplaceholder.typicode.com/todos/1"
).then((r) => r.json());
res.json({ result });
});
app.use((req, res, next) => {
req.startTime = Date.now();
next();
});
app.get("/delay", async (req, res) => {
await new Promise((r) => setTimeout(r, 200));
res.json({ elapsed: Date.now() - req.startTime });
});
Brahma-Firelight ships prebuilt native binaries for macOS, Linux and Windows so you don't need to compile the native addon locally.
Supported artifact filenames (what the JS loader will try to load):
brahma-js.darwin-arm64.nodebrahma-js.darwin-x64.nodebrahma-js.linux-x64-gnu.nodebrahma-js.linux-arm64-gnu.nodebrahma-js.win32-x64-msvc.node👉 Forked from Brahma-Core. An open source repository Brahma-Core.
MIT © LICENSE
FAQs
A blazing-fast, fire-and-forget orchestrator built with Rust and JavaScript, designed for ultra-low-latency task routing, message triggering, and heavyweight logic execution — all without blocking. A native Rust AddOn for NodeJS, BunJS and DenoJS.
The npm package brahma-firelight receives a total of 22 weekly downloads. As such, brahma-firelight popularity was classified as not popular.
We found that brahma-firelight demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Export Socket alert data to your own cloud storage in JSON, CSV, or Parquet, with flexible snapshot or incremental delivery.

Research
/Security News
Bitwarden CLI 2026.4.0 was compromised in the Checkmarx supply chain campaign after attackers abused a GitHub Action in Bitwarden’s CI/CD pipeline.

Research
/Security News
Docker and Socket have uncovered malicious Checkmarx KICS images and suspicious code extension releases in a broader supply chain compromise.