
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@decky.fx/node-server
Advanced tools
This is a simple nodejs server, it has zero dependancy!
git clone https://github.com/deckyfx/sea-builder.git
Make sure nvm is installed, and install node version 20.16.0, visit https://github.com/nvm-sh/nvm for more detail
Set node version
nvm use
Check node version
node --version
it should return
v20.17.0
Make sure yarn is installed, if not use
npm install --global yarn
Install dependecies
yarn install
1.0.7-d
Install with
npm i @decky.fx/node-server
See example folder
import { server, any, onError, get, post, routes } from "../src/index";
const hostname = "0.0.0.0";
const port = 3000;
any("/", async function _any(handle) {
handle.json({ result: "OK" });
return true;
});
post("/test", async function _post(handle) {
handle.json({ result: "OK" });
return true;
});
get("/html", async function _html(handle) {
handle.html(handle.readFile("assets", "public", "file.html"));
return true;
});
onError(async function _error(handle) {
const { req, res, ...data } = handle;
console.log(data);
});
server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
The server object created by node:http
Add GET route
Add POST route
Add PUT route
Add DELETE route
Add OPTIONS route
Add route catching any methods
Add route for method xxx
Flag the server as up
Flag the server as down for maintenance
Flag CORS enabled / disabled, if enabled, response will send extra headers for CORS handler, and when adding POST route will also adds OPTIONS route to same path to handle preflight request
Set public dir to serve static files, default is ./public
Set default upload dir, default is ./uploads
Add hooks when error happened during request route parsing
Add hooks that trigger before a default File handler triggered
Add hooks that trigger before a default Index handler triggered
Return current configured routes
Render template and generate string data of rendered template
Send basic string to connected client
Send basic string of JSON stringified data to connected client
Send static file contents to connected client
Redirect client to new path
The callback that called when a route is handled, starting from 1.0.5, the callback only provide single argument, a HTTPHandler instance
The Handler data passed when trigger RouteHandler.
The Handler would have the following readonly properties:
The Handler would have the following methods:
Send and end request with text
Send and end request with json data
Send and end request with html string data
Send and end request with redirect header
Send and end request with error
Send headers for CORS
Process a template file and return the string result
Read file as string data
Send file response, as file download when disposition = true, or as common HTTP file response (eg: js, css, image)
Cookie instance has the following methods
Return all cookies
Set a cookie
remove
clear all cookies
Session instance has the following methods
Return all sessions
Set a session
remove a session
clear all sessions
FAQs
A Zero Dependancy NodeJS Server
We found that @decky.fx/node-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.