@hoobs/network
TypeScript icon, indicating that this package has built-in type declarations

1.0.20 • Public • Published

Library for interacting with network interfaces on Debian based systems.

Prerequisites

This library is designed for Debian systems, and requires a few packages to be installed.

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

Installing

HOOBS recommends Yarn. From your project's root run;

yarn add @hoobs/network

Or using NPM.

npm install @hoobs/network

Usage

First inport this into your code.

const network = require("./network");

Fetch a list of active connections.

const connections = network.current();

if (network.connected) {
    console.log(connections);
}

Fetch a list of network devices.

const devices = network.devices();

Fetch a list of available wireless networks.

const networks = network.wireless.scan();

Connect/Disconnect a wireless network.

network.wireless.connect("ssid", "password");
network.wireless.disconnect();

Forget a network.

network.wireless.forget("ssid");

Up/Down a wired connection.

network.ethernet.up("eth0");
network.ethernet.down("eth0");

Legal

HOOBS and the HOOBS logo are registered trademarks of HOOBS Inc. Copyright (C) 2021 HOOBS Inc. All rights reserved.

Readme

Keywords

none

Package Sidebar

Install

npm i @hoobs/network

Weekly Downloads

6

Version

1.0.20

License

GPL-3.0

Unpacked Size

65.4 kB

Total Files

19

Last publish

Collaborators

  • pminder
  • pfy
  • mkellsy
  • askovi
  • bobbyslope