Socket
Socket
Sign inDemoInstall

@influxdata/influx

Package Overview
Dependencies
4
Maintainers
11
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @influxdata/influx

InfluxDB 2.0 client


Version published
Weekly downloads
104
increased by477.78%
Maintainers
11
Install size
5.31 MB
Created
Weekly downloads
 

Readme

Source

InfluxDB 2.0 browser JavaScript client

Disclaimer

This library is a work in progress and should not be considered production ready pre v1.0.

Usage

Initializing the client


import Client from '@influxdata/influx'

const client = new Client('basepath', 'token')

Querying

Using the client to execute a query:

const query = 'from(bucket: "my_bucket") |> range(start: -1h)'

const {promise, cancel} = client.queries.execute('someorgid', query)

const csv = await promise

The returned promise will eventually resolve with a Flux CSV.

The request can also be canceled with the returned cancel function, in which case the promise will reject with a CancellationError:

cancel() // Cancels request

Writing

Data written to the database should be in line protocol


const data = '' // Line protocal string

const response = await client.write.create('orgID', 'bucketID', data)

Development

Requirements

  • OpenJDK 8 or higher
  • Node 10.x or higher

Installing dependencies

yarn

Generating base from swagger

yarn run generate

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 logged into Yarn (yarn login)
  • You are on master and the working tree is clean

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

./publish

Keywords

FAQs

Last updated on 22 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc