node-ufw
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

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.

Installation

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

Usage

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("192.168.0.1");
await nodeUfw.deny.address("192.168.0.1", 80);
await nodeUfw.allow.address("192.168.0.1", 6379, "udp");

await nodeUfw.enable();

Documentations

See DOCS.

LICENSE

See LICENSE.

Package Sidebar

Install

npm i node-ufw

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

30.8 kB

Total Files

25

Last publish

Collaborators

  • ray_1337