Brahma-JS delivers Rust-level performance without the need to write Rust. It features an Express-like API, making it accessible for JavaScript developers. Built with Tokio and Hyper, this lightweight, zero-dependency solution is tailored for high-performance microservices and APIs, achieving over 130k requests per second with minimal latency.
Brahma-JS is an advanced orchestrator designed for JavaScript applications, combining the simplicity of an Express-like API with the robust performance of Rust. This framework is tailored for micro-service and API applications where minimizing latency is crucial.
Brahma-JS has demonstrated impressive benchmarks:
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
Brahma-JS can handle over 130k requests per second while maintaining low latency, a direct result of its optimized Rust core and familiar API design.
To get started with Brahma-JS, simply install it using your package manager of choice:
npm install brahma-firelight
# or
yarn add brahma-firelight
# or
pnpm add brahma-firelight
# or
bun add brahma-firelight
The following code snippet demonstrates setting up a simple server:
const { createApp } = require("brahma-firelight");
const app = createApp();
app.get("/hi", (req, res) => {
res.json({ message: "Hello World from Brahma-JS!" });
});
app.listen("0.0.0.0", 2000, () => {
console.log("Server listening on port 2000");
});
app.get("/hello", (req, res) => {
res.send("Hi there!");
});
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-JS is currently in beta, constantly evolving based on user feedback and performance observations. Early adopters are encouraged to contribute and provide insights to enhance the project.
Brahma-JS offers precompiled binaries for macOS, Linux, and Windows, eliminating the need for local compilation of native dependencies:
brahma-js.darwin-arm64.nodebrahma-js.darwin-x64.nodebrahma-js.linux-x64-gnu.nodebrahma-js.linux-arm64-gnu.nodebrahma-js.win32-x64-msvc.nodeBrahma-JS is a fork of the Brahma-Core project. This framework is open-source and welcomes contributions.
No comments yet.
Sign in to be the first to comment.