8000 GitHub - influxdata/influxdb-client-js at 23525d278f7efa6d5c68ed76e6ead70164287516
[go: up one dir, main page]

Skip to content

influxdata/influxdb-client-js

Repository files navigation

influxdb-client-javascript

CircleCI codecov code style: prettier License npm GitHub issues GitHub pull requests Slack Status

This repository contains the reference javascript client for InfluxDB 2.0. Both node and browser environments are supported.

Note: Use this client library with InfluxDB 2.x and InfluxDB 1.8+. For connecting to InfluxDB 1.7 or earlier instances, see the node-influx client library.

Features

InfluxDB 2.0 client consists of two packages

  • @influxdata/influxdb-client
    • Querying data using the Flux language
    • Writing data
      • batched in chunks on background
      • automatic retries on write failures
  • @influxdata/influxdb-client-js-apis
    • provides all other InfluxDB 2.0 APIs for managing
      • sources, buckets
      • tasks
      • authorizations
      • health check
      • ...
    • built on top of @influxdata/influxdb-client-js

Installation

To use write or query InfluxDB in your project:

$npm install --save @influxdata/influxdb-client

or

$yarn add @influxdata/influxdb-client

To use InfluxDB management APIs in your project:

$npm install --save @influxdata/influxdb-client-apis

or

$yarn add @influxdata/influxdb-client-apis

Usage

See examples

InfluxDB 2.0 API compatibility endpoints are part of the InfluxDB 1.x line since InfluxDB 1.8.0. This allows you to leverage InfluxDB 2.0 client libraries for both writing and querying data with Flux. For more details, see

Build Requirements

  • node v12.13.1 or higher (older versions will work as well)
  • yarn 1.9.4. or higher (older versions will work as well)

Run all unit tests:

$ yarn test:unit

Check code coverage of unit tests:

$ yarn coverage

Development

Releasing a new version

Ensure that:

  • You have administrator access to this repo on GitHub
  • You have permissions to publish to the influxdata organization on npm
  • You are on master and the working tree is clean

Then run the publish script in the root of the repo:

make publish VERSION=1.1.0

Contributing

If you would like to contribute code you can do through GitHub by forking the repository and sending a pull request into the master branch.

License

The InfluxDB 2.0 javascript client is released under the MIT License.

0