New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

device-status

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

device-status

device events on network status changes

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

device-status

Build Status

device events on network status changes

How

first, npm install device-status. then, with one host...

var assert = require('assert');
var ds = require('device-status');

ds("127.0.0.1").on("change", function (host, status) {
    assert.equal(host, "127.0.0.1");
    assert.equal(status, true);
});

or with many hosts...

var assert = require('assert');
var ds = require('device-status');

ds("127.0.0.1", "www.bing.com").on("change", function (host, status) {
    // host will be either `www.bing.com` or `127.0.0.1`
    // status will be either `true` or `false`
});

or with a custom probe interval (default is 5s)...

var assert = require('assert');
var ds = require('device-status');

// probe every 10s - which is  10000ms
ds("127.0.0.1", 10000).on("change", function (host, status) {
    assert.equal(host, "127.0.0.1");
    assert.equal(status, true);
});

License

MIT

Keywords

device

FAQs

Package last updated on 06 Feb 2016

Did you know?

Socket

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.

Install

Related posts