# chainpoint-influx

> A Node.js wrapper around the officially supported InfluxDB package. Supports batching, suppression of captured events to enable/disable writing to InfluxDB.

Latest version **1.0.0** (published 2018-10-15) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install chainpoint-influx
pnpm add chainpoint-influx
yarn add chainpoint-influx
bun add chainpoint-influx
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2018-10-15 |
| First published | 2018-10-15 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 137.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Michael Iglesias |
| Maintainers | grempe |
| Keywords | influx, influxdb, monitoring, logging, tick |

## Links

- npm: https://www.npmjs.com/package/chainpoint-influx
- npm.io page: https://npm.io/package/chainpoint-influx

## Dependencies (7)

- [async](https://npm.io/package/async.md) ^2.4.1
- [influx](https://npm.io/package/influx.md) ^5.0.7
- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [moment](https://npm.io/package/moment.md) ^2.22.2
- [request](https://npm.io/package/request.md) ^2.81.0
- [async-retry](https://npm.io/package/async-retry.md) ^1.1.4
- [request-promise-native](https://npm.io/package/request-promise-native.md) ^1.0.4

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2018-10-15

## README

# Chainpoint Influx

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

A lightweight wrapper around the officially supported [influx](https://github.com/node-influx/node-influx) package providing simple batching functionality and enable/disable of writes.

## Installation

For Node, simply:

```shell
$ yarn add chainpoint-influx
```

## Usage

```javascript
const { InfluxDB } = require('chainpoint-influx')
```

To instantiate an Influx object, make the same constructor as you would with the officially supported `influx` package and pass an additional `config` object which is optional and whose object signature can be seen in the code snippet below.

```javascript
const influx = new InfluxDB(<IClusterConfig|ISingleHostConfig|string>, {
    enabled: true,
    batching: true,
    batchSize: 10,
    flushingInterval: 15 * 1000 // 15secs
})
```

|     Properties     |                                        Description                                         | Required | Type                                      |
| :----------------: | :----------------------------------------------------------------------------------------: | :------: | ----------------------------------------- |
| Connection Options |     Connect to a single InfluxDB instance by specifying a set of connection options..      |   yes    | `IClusterConfig|ISingleHostConfig|string` |
|       Config       | `{ enabled?: boolean, batching?: boolean, batchSize?: Number, flushingInterval?: Number }` |    no    | object                                    |

## How this package differs from `influx`

NOTE: This package only introduces two mutation points towards the original `influx` package which are as follows:

> 1. This package overrides the method: `writePoints()`
> 2. This package introduces a new method `flushEventQueue()` which is only invoked when `batching` has been enabled

Also, flushing the event queue is something that cannot be overwritten, if `batching` has been enabled, the event queue will always be flushed at the specified (or default of 10 seconds) interval.

## License

[Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0)

```text
Copyright (C) 2018 Tierion

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

---
_Source: https://npm.io/package/chainpoint-influx · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
