lan-ns-ticker

1.0.4 • Public • Published

lan-ns-ticker

Javascript client that notifies LanNS service at specified intervals that the web server / service on the local network is running.

Installation

npm install lan-ns-ticker

Usage

Initialization

const Ticker = require("lan-ns-ticker");
const ticker = new Ticker(options);

Options

url: <string>                       LanNS Service url
appName: <string>
appDescription: <string>            default: ""
appPort: <number>
appUrlPath: <string>                default: ""
appProtocol: <string>               default: "http"
refreshIntervalInSeconds: <number>  default: 60, min: 30
expireTimeInSeconds: <number>       default: 120, min: 2*refreshIntervalInSeconds
networkInterfaceFilter: <string>    default: "", e.g. "Local Area Connection" (Usefull when excluding private IP addresses for virtual Ethernet adapters. Can be also a semicolon-separated list of interface names.)

Methods

start( onError )
    onError  function(error)
    
    Starts the ticker object to sending notifications to LanNS service with specified intervals.
    
stop()
    Stops the ticker notifications.

Example

const Ticker = require("lan-ns-ticker")
new Ticker({
    url: "https://www.mylannsservice.net:3003",
    appName: "Musa",
    appDescription: "Musa Music Player",
    appPort: 3001,
    appProtocol: "http",
    appUrlPath: "",
    refreshIntervalInSeconds: 60,
    expireTimeInSeconds: 180
}).start(( error ) => { console.log( error ); });

Dependents (0)

Package Sidebar

Install

npm i lan-ns-ticker

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

13.9 kB

Total Files

6

Last publish

Collaborators

  • ollikekalainen