JavaScript and InfluxDB
Powerful performance with an easy integration, powered by Telegraf, the open source data connector built by InfluxData.
5B+
Telegraf downloads
#1
Time series database
Source: DB Engines
1B+
Downloads of InfluxDB
2,800+
Contributors
Table of Contents
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started
Build IoT, analytics, and cloud applications using the JavaScript client library with InfluxDB.
Why use the InfluxDB JavaScript Client Library?
InfluxDB is an API-first time series database for your JavaScript applications. Use the InfluxDB open-source JavaScript API client to write and query data in Node.js, browser, and Deno environments and even manage your InfluxDB instance from within your application.
Key features
- Provides API access to all InfluxDB Write and Read functionality, settings, and advanced features
- Write data in InfluxDB line protocol or point data structure
- Automatically retry requests on failure
- Batch data to InfluxDB to gain greater efficiency
- Return InfluxDB data as a Flux Table Structure, string, csv, stream, or dataframe
- Delete data from a particular bucket
- Invoke a Flux script
- Create and manage your environment (buckets, tasks, authorization, source)
Get started
Read
Write
const {InfluxDB, flux} = require('@influxdata/influxdb-client')
// const url = "https://us-west-2-1.aws.cloud2.influxdata.com";
const url = "http://localhost:9999";
const token = 'my-token'
const org = 'my-org'
const bucket = 'my-bucket'
const client = new InfluxDB({url: url, token: token})
const queryApi = client.getQueryApi(org)
const query = flux`from(bucket: "${bucket}")
|> range(start: -1d)
|> filter(fn: (r) => r._measurement == "weatherstation")`
queryApi.queryRows(query, {
next(row, tableMeta) {
const o = tableMeta.toObject(row)
console.log(`${o._time} ${o._measurement}: ${o._field}=${o._value}`)
},
error(error) {
console.error(error)
console.log('Finished ERROR')
},
complete() {
console.log('Finished SUCCESS')
},
})
Powerful Performance, Limitless Scale
Collect, organize, and act on massive volumes of high-velocity data. Any data is more valuable when you think of it as time series data. with InfluxDB, the #1 time series platform built to scale with Telegraf.
See Ways to Get Started