From 708210417c6f45da31f325f6142ea9250a29d41a Mon Sep 17 00:00:00 2001 From: ray-1337 <33544674+ray-1337@users.noreply.github.com> Date: Tue, 12 Apr 2022 00:22:34 +0200 Subject: [PATCH] added documentations --- README.md | 3 +++ docs/DOCS.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 docs/DOCS.md diff --git a/README.md b/README.md index ba0cb88..39febd8 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,8 @@ await nodeUfw.allow.address("192.168.0.1", 6379, "udp"); await nodeUfw.enable(); ``` +## Documentations +See [DOCS](https://github.com/ray-1337/node-ufw/blob/master/docs/DOCS.md). + ## LICENSE MIT \ No newline at end of file diff --git a/docs/DOCS.md b/docs/DOCS.md new file mode 100644 index 0000000..2998205 --- /dev/null +++ b/docs/DOCS.md @@ -0,0 +1,49 @@ +# Node UFW Docs + +## .allow.port(port: number, protocol?: "udp" | "tcp") +Allow incoming requests through specific port. +```js +await nodeUfw.allow.port(6379); +nodeUfw.allow.port(6379, "udp"); +``` +> returns `Promise` + +## .allow.address(address: string, port?: number, protocol?: "udp" | "tcp") +Allow incoming requests through specific (IP) address. +```js +await nodeUfw.allow.address("192.168.0.1"); +nodeUfw.allow.address("192.168.0.1", 6379); +``` +> returns `Promise` + +## .deny.port(port: number, protocol?: "udp" | "tcp") +Deny incoming requests through specific port. +```js +await nodeUfw.deny.port(6379); +nodeUfw.deny.port(6379, "udp"); +``` +> returns `Promise` + +## .deny.address(address: string, port?: number, protocol?: "udp" | "tcp") +Deny incoming requests through specific (IP) address. +```js +await nodeUfw.deny.address("192.168.0.1"); +nodeUfw.deny.address("192.168.0.1", 6379); +``` +> returns `Promise` + +## .delete(num: number) +Delete ufw rule. The number rule starts from number 1. See `sudo ufw status numbered` for more information. +> returns `Promise` + +## .disable() +Disable UFW. +> returns `Promise` + +## .enable() +Enable UFW. +> returns `Promise` + +## .status(raw?: boolean) +List of currently activated UFW. +> returns `Promise` \ No newline at end of file