IP Wrapper is a Node.js library that provides functions for managing network interfaces and IP addresses on a Linux system using the ip command.
To install the library, use npm:
npm install ip-wrapperconst ipWrapper = require('ip-wrapper');
(async () => {
const addresses = await ipWrapper.addr.show();
await ipWrapper.addr.add('enp6s0', '6.6.6.6/32');
await ipWrapper.addr.remove('enp6s0', '6.6.6.6/32');
await ipWrapper.addr.flush('enp6s0');
})();All examples are located in the examples directory.
We use Jest for testing. To run the tests, use the following command:
npm run testView the LICENSE.md file.