simple-influx-http

Tiny library for InfluxDB data write


Keywords
influx
License
Unlicense
Install
npm install simple-influx-http@0.0.6

Documentation

Dependencies LCommit

Downloads NPM Node

Size install size

Tiny library for InfluxDB data write

Use command this way:

const {writeToInflux} = require('simple-influx-http');

(async () => {
    await writeToInflux({
        url: 'http://localhost:8086',     // influx http api url with port
        db: 'myData',                     // database name
        meas: 'water',                    // measurement name
        tags: {                           // tags to add
            country: 'russia',
            city: 'sochi',
        },
        values: {                         // values to send
            temp: 24,
            desc: 'good time to swim',
        },
        timestamp: '1476742925219947761', // time to add                (default = current)
        retry: 3,                         // superagent request retries (default = 3)
        timeout: {                        // superagent request timeout (default = 10000/20000)
            response: 10000,
            deadline: 20000,
        }
    });
})();