Library for interacting with network interfaces on Debian based systems.
npm install @hoobs/networkLibrary for interacting with network interfaces on Debian based systems.
```
sudo apt install wpasupplicant network-manager dnsmasq hostapd
Next you need to disable the dnsmasq and hostapd services. These services will be dynamically configured and controled by this library.
``
sudo systemctl disable dnsmasq
sudo systemctl disable hostapd
`sh`
yarn add @hoobs/network
Or using NPM.
`sh`
npm install @hoobs/network
`js`
const network = require("./network");
Fetch a list of active connections.
`js
const connections = network.current();
if (network.connected) {
console.log(connections);
}
`
Fetch a list of network devices.
`js`
const devices = network.devices();
Fetch a list of available wireless networks.
`js`
const networks = network.wireless.scan();
Connect/Disconnect a wireless network.
`js`
network.wireless.connect("ssid", "password");
network.wireless.disconnect();
Forget a network.
`js`
network.wireless.forget("ssid");
Up/Down a wired connection.
`js``
network.ethernet.up("eth0");
network.ethernet.down("eth0");