sugo-observer

2.0.16 • Public • Published

Title Banner

Build Status npm Version JS Standard

Remote observer for SUGOS

SUGO-Observer works as a client of SUGO-Hub and provides accessors to observe the cloud server status.

Requirements

banner banner

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.

Links

Readme

Keywords

Package Sidebar

Install

npm i sugo-observer

Weekly Downloads

2

Version

2.0.16

License

Apache-2.0

Last publish

Collaborators

  • okunishinishi
  • realglobe