sugo-observer
v2.0.16
Published
Remote observer for SUGOS
Downloads
3
Readme
Remote observer for SUGOS
SUGO-Observer works as a client of SUGO-Hub and provides accessors to observe the cloud server status.
Requirements
Installation
$ npm install sugo-observer --save
Usage
#!/usr/bin/env node
/**
* This is an example to use observer to observe hub
*/
'use strict'
const sugoObserver = require('sugo-observer')
async function tryExample () {
let observer = sugoObserver((data) => {
console.log('Data changed:', data)
/* ... */
}, {
host: 'my-sugo-hub.example.com'
})
await observer.start() // Start observing
/* ... */
await new Promise((resolve) => setTimeout(resolve, 80000))
await observer.stop() // Stop observing
}
tryExample().catch((err) => console.error(err))
License
This software is released under the Apache-2.0 License.