Observe network change event in Node.js.
Important
This package is working in progress, and only support Windows and macOS now.
yarn add @napi-rs/network-change
pnpm add @napi-rs/network-change
import { NwPathMonitor } from '@napi-rs/network-change';
const monitor = new NwPathMonitor();
monitor.start((path) => {
console.log('network change', path);
});