|
1 | | -# mikrotik-wireguard-client-manager |
2 | | -A Node.js package for managing WireGuard VPN clients on MikroTik routers via SSH |
| 1 | +A Node.js package for managing WireGuard VPN clients on MikroTik routers via SSH. |
| 2 | + |
| 3 | +**This project has a [Code of Conduct](CODE_OF_CONDUCT.md).** |
| 4 | + |
| 5 | +## Table of contents |
| 6 | + |
| 7 | +* [Installation](#Installation) |
| 8 | +* [Features](#Features) |
| 9 | +* [Running Tests](#Running-Tests) |
| 10 | +* [Contributing](#Contributing) |
| 11 | +* [License](#license) |
| 12 | + |
| 13 | +```js |
| 14 | +const { MikroTikWireGuardClientManager } = require('@nimisha.gj/mikrotik-client-manager') |
| 15 | +const { MikroTikSSHClient } = require("@nimisha.gj/mikrotik-client-manager"); |
| 16 | + |
| 17 | +const sshClient = new MikroTikSSHClient("192.168.1.1", 22, "admin", "password"); |
| 18 | + |
| 19 | +const vpnManager = new MikroTikWireGuardClientManager(sshClient); |
| 20 | +const clients = await vpnManager.listClients(); |
| 21 | +``` |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +This is a [Node.js](https://nodejs.org/en/) module available through the |
| 26 | +[npm registry](https://www.npmjs.com/). |
| 27 | + |
| 28 | +Before installing, [download and install Node.js](https://nodejs.org/en/download/). |
| 29 | +Node.js 22 or higher is required. |
| 30 | + |
| 31 | +If this is a brand new project, make sure to create a `package.json` first with |
| 32 | +the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file). |
| 33 | + |
| 34 | +Installation is done using the |
| 35 | +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): |
| 36 | + |
| 37 | +```bash |
| 38 | +npm install @nimisha.gj/mikrotik-client-manager |
| 39 | +``` |
| 40 | +## Features |
| 41 | +* Add WireGuard Client |
| 42 | +* Remove WireGuard Client |
| 43 | +* List WireGuard Clients |
| 44 | + |
| 45 | + |
| 46 | +### Running Tests |
| 47 | + |
| 48 | +To run the test suite, first install the dependencies: |
| 49 | + |
| 50 | +```bash |
| 51 | +npm install |
| 52 | +``` |
| 53 | + |
| 54 | +Then run `npm test`: |
| 55 | + |
| 56 | +```bash |
| 57 | +npm test |
| 58 | +``` |
| 59 | + |
| 60 | +## Contributing |
| 61 | + |
| 62 | +The project welcomes all constructive contributions. Contributions take many forms, |
| 63 | +from code for bug fixes and enhancements, to additions and fixes to documentation, additional |
| 64 | +tests, triaging incoming pull requests and issues, and more! |
| 65 | + |
| 66 | +See the [Contributing Guide](CONTRIBUTING.md) for more technical details on contributing. |
| 67 | + |
| 68 | +## License |
| 69 | + |
| 70 | +[MIT](LICENSE) |
0 commit comments