
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
node-network-manager
Advanced tools
Network Setting and Get Network Info (IP, Lan, Wifi and ...)
- This package works only `linux` based systems
+ linux on PC, Raspberry-pi, Orange-pi and ...
- This package required to `nmcli` (`network-manager`)
npm install node-network-manager --save
app.js
const network = require("node-network-manager");
network
.getConnectionProfilesList()
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.enable()
.then(() => console.log("network has just turned on"))
.catch((error) => console.log(error));
network
.disable()
.then(() => console.log("network has just turned off"))
.catch((error) => console.log(error));
network
.getNetworkConnectivityState(true)
.then((hostName) => console.log(hostName))
.catch((error) => console.log(error));
network
.deviceStatus()
.then((result) => console.log(result))
.catch((error) => console.log(error));
network
.deviceStatus("enp4s0")
.then((result) => console.log(result))
.catch((error) => console.log(error));
network
.deviceStatus("enp4s0")
.then((result) => console.log(result))
.catch((error) => console.log(error));
network
.wifiEnable()
.then(() => console.log("wifi was enabled"))
.catch((error) => console.log(error));
network
.wifiDisable()
.then(() => console.log("wifi was disabled"))
.catch((error) => console.log(error));
network
.getWifiStatus()
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.wifiHotspot("wlo1", "ssid1988", "1234567890")
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.wifiCredentials("wlo1")
.then((data) => console.log(data))
.catch((error) => console.log(error));
const fs = require("fs");
const path = require("path");
const myFile = fs.createWriteStream(path.join(__dirname, "myOutput.txt"));
network
.activityMonitor(process.stdout)
.then((endStream) => {
console.log("start monitor");
setTimeout(() => {
console.log("stop monitor");
endStream();
}, 5000);
})
.catch((error) => console.log(error));
network
.activityMonitor(myFile)
.then((endStream) => {
console.log("start monitor");
setTimeout(() => {
console.log("stop monitor");
endStream();
}, 5000);
})
.catch((error) => console.log(error));
network
.getConnectionProfilesList()
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.connectionUp("79373ad4-c462-43f7-90bd-ffdd4036623f")
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.connectionDown("79373ad4-c462-43f7-90bd-ffdd4036623f")
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.getWifiList(true)
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.wifiConnect("Your-Access-Point-SSId", "AP-Password")
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.wifiConnect("Your-Access-Point-SSId", "AP-Password", true)
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.getIPv4()
.then((ipData) => console.log(ipData))
.catch((error) => console.log(error));
network
.getHostName()
.then((hostName) => console.log(hostName))
.catch((error) => console.log(error));
network
.setHostName(hostName)
.then((hostName) => console.log(result))
.catch((error) => console.log(error));
network
.getConnectionProfilesList(false)
.then((data) => {
const ethernet = data.find((item) => item.TYPE === "ethernet");
const wifi = data.find((item) => item.TYPE === "wifi");
network
.getDeviceInfoIPDetail(ethernet.DEVICE)
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.getDeviceInfoIPDetail(wifi.DEVICE)
.then((data) => console.log(data))
.catch((error) => console.log(error));
})
.catch((error) => console.log(error));
network
.getAllDeviceInfoIPDetail()
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.connectionDelete("b23522e9-c50e-43c2-bdca-ec0a5735b2ec")
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.addGsmConnection(
"gsm_test_delete_me",
"*",
"apn",
"username",
"password",
"1234"
)
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.addEthernetConnection(
"test_connection_1",
"enp0s3",
"192.168.1.161",
"192.168.1.1"
)
.then((data) => console.log(data))
.catch((error) => console.log(error));
network
.changeDnsConnection("test_connection_1", "8.8.8.8 8.8.4.4")
.then((data) => console.log(data))
.catch((error) => console.log(error));
This project is licensed under the MIT License
FAQs
Network Manager for Nodejs
The npm package node-network-manager receives a total of 51 weekly downloads. As such, node-network-manager popularity was classified as not popular.
We found that node-network-manager demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.