https://github.com/ray-1337/node-ufw
Manipulate UFW via Node.js.
https://github.com/ray-1337/node-ufw
cli linux node nodejs ubuntu ufw ufw-firewall
Last synced: 2 months ago
JSON representation
Manipulate UFW via Node.js.
- Host: GitHub
- URL: https://github.com/ray-1337/node-ufw
- Owner: ray-1337
- License: mit
- Created: 2022-04-11T21:56:30.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T20:24:36.000Z (about 2 years ago)
- Last Synced: 2025-03-24T08:21:22.129Z (3 months ago)
- Topics: cli, linux, node, nodejs, ubuntu, ufw, ufw-firewall
- Language: TypeScript
- Homepage: https://npmjs.com/node-ufw
- Size: 77.1 KB
- Stars: 4
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Node UFW
Manipulate UFW (Linux distribution only) through Node.js.## System Requirements
The module only supports [Node.js](https://nodejs.org) 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
```shell
$ npm install node-ufw
$ pnpm add node-ufw
```## Usage
```js
const nodeUfw = require("node-ufw"); // JavaScript
import * as nodeUfw from "node-ufw"; // TypeScriptawait 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](docs/DOCS.md).## LICENSE
See [LICENSE](LICENSE).