Overlock Client Library for NodeJS

NOTE: Before the Client will work, please see information about installing the Overlock agent!

Downloading

npm install --save overlock-nodejs

Installing

In ES6

overlock = require('overlock');

overlock.install('node-process', {
    version: '2.0.1',
    hardware_version: get_hardware_version()
})

Or plain JS:

import {install, log, send_lifecycle} from 'overlock'

install('node-process', {
    version: '2.0.1',
    hardware_version: get_hardware_version()
})

Using

With the library installed in your code, you're ready to start instrumenting your code.


var ol = require('overlock')

try {
    ol.log("getting sensor value")
    value = read_sensor()
    ol.set_state({sensor_value})
    ol.log("done")
    return value
}
catch(e){
    ol.set_state({sensor_value:0})
    ol.error("could not read sensor value")
}

Documentation and Source

Full documentation can be found in the README in the source on Github

Bugs and questions

For any general problems, head over to the community forums or for specific problems, github issues