Node.js interface to UFW forked to allow execution of your Node process as non-root user.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rob Colbert 03f22a2d5e v2.0.5 5 months ago
.github Create FUNDING.yml 2 years ago
docs added logging method 2 years ago
src fix syntax of ufw command 5 months ago
.gitignore ignore transpiled folder and lock files 6 months ago
LICENSE added MIT license 2 years ago fix incorrect import example 6 months ago
Test.ts refactor file test to typescript 6 months ago
package.json v2.0.5 5 months ago
release release script 5 months ago
tsconfig.json major refactor to typescript 6 months ago
yarn.lock added tslib dev dependency 5 months ago

Node UFW

Manipulate UFW (Linux distribution only) through Node.js.

System Requirements

The module only supports Node.js up to version 16, and Ubuntu version 18 or above.

This also requires root access, otherwise you will get an error from ufw itself, asking you a password with prompt.


$ npm install node-ufw
$ pnpm add node-ufw


const nodeUfw = require("node-ufw"); // JavaScript
import * as nodeUfw from "node-ufw"; // TypeScript

await nodeUfw.allow.port(6379);
await nodeUfw.deny.port(25565, "udp");

await nodeUfw.allow.address("");
await nodeUfw.deny.address("", 80);
await nodeUfw.allow.address("", 6379, "udp");

await nodeUfw.enable();