influxdb-v1
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

influxdb-v1

A light-weight library to write data to InfluxDB.

  • Parse Special Characters
  • Inbuilt Retry Mechanisms

Example

const influx = require('influxdb-v1');

await influx.write(
    {
      url: 'http://influx.url',
      db: 'database name'
    },
    [
      {
        measurement: 'web',
        fields: {
          load: 12.34
        }
      },
      {
        measurement: 'web',
        fields: {
          load: 5.4
        },
        tags: {
          host: 'linux'
        },
        timestamp: Date.now()
      }
    ]
  );

// or

const db = influx.db({ url: 'http://influx.url', db: 'database name'});
await db.write({
  measurement: 'web',
  fields: {
    load: 12.34
  }
});

// query

const db = influx.db({ url: 'http://influx.url', db: 'database name', username: 'user', password: 'pass' });
await db.query('SELECT * FROM measurement');
await db.flux('from(bucket:"telegraf")');

CLI

Insert Data

npx influxdb-v1 insert --url <influx-base-url> --username <user> --password <pass> --db <database> --measurement <measurement> --tags "key=value" --fields "key=value" --ts <timestamp>

Note

Inspired from influxdb-v2

Readme

Keywords

Package Sidebar

Install

npm i influxdb-v1

Weekly Downloads

2,123

Version

1.0.4

License

MIT

Unpacked Size

8.9 kB

Total Files

7

Last publish

Collaborators

  • asaianudeep