https://github.com/martinheidegger/network-interfaces
Observing network interfaces and changes to them.
https://github.com/martinheidegger/network-interfaces
networks nodejs
Last synced: 3 months ago
JSON representation
Observing network interfaces and changes to them.
- Host: GitHub
- URL: https://github.com/martinheidegger/network-interfaces
- Owner: martinheidegger
- License: mit
- Created: 2019-04-02T18:34:34.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-13T22:11:11.000Z (about 5 years ago)
- Last Synced: 2024-12-23T23:30:00.708Z (7 months ago)
- Topics: networks, nodejs
- Language: JavaScript
- Size: 72.3 KB
- Stars: 6
- Watchers: 4
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# network-interfaces
![]()
[](https://standardjs.com)
[](https://codeclimate.com/github/martinheidegger/network-interfaces/maintainability)
[](https://codeclimate.com/github/martinheidegger/network-interfaces/test_coverage)`network-interfaces` is similar to `os.networkInterfaces()` but offers a cross-platform util to listen to changes
in the network setup.`npm i @leichtgewicht/network-interfaces --save`
## Usage
The simplest usage of it is by using creating a change-stream:
```javascript
const { networkInterfaces, JSONStringMode } = require('@leichtgewicht/network-interfaces')
const { changes, warnings } = networkInterfaces.stream(JSONStringMode.line)changes.pipe(process.stdout)
warnings.pipe(process.stderr)
```By the way, you can also get this through npx 😍
```sh
$ npx @leichtgewicht/network-interfaces
```## API
For the time being, look into:
[./index.d.ts](./index.d.ts)
### License
[MIT](./LICENSE)