Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/goliatone/influx-line-protocol-parser
InfluxDB line protocol parser library
https://github.com/goliatone/influx-line-protocol-parser
Last synced: 11 days ago
JSON representation
InfluxDB line protocol parser library
- Host: GitHub
- URL: https://github.com/goliatone/influx-line-protocol-parser
- Owner: goliatone
- License: mit
- Created: 2016-08-15T14:52:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-25T21:24:19.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T09:08:22.084Z (27 days ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 6
- Watchers: 2
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT
Awesome Lists containing this project
README
# Influx Line Protocol Parser
The line protocol is a text based format for writing points to InfluxDB. This library provides a simple parser to generate a JavaScript Object from a provided line.
## Getting Started
Install the module with: `npm install influx-line-protocol-parser`## Examples
```js
var lineToJSON = require('influx-line-protocol-parser');
var line = 'cpu_load_short,direction=in,host=server01,region=us-west value=2.0 1422568543702900257';
var point = lineToJSON(line);
console.log(point);
``````js
{
measurement: 'cpu_load_short',
timestamp: 1422568543702900257,
fields: [{
value: 2
}],
tags:[
{direction: 'in'},
{host: 'server01'},
{region: 'us-west'},
]
}
```## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).## Release History
* 2016-08-15 v0.1.0: Initial release
* 2016-08-15 v0.2.0: Remove unused bin## License
Copyright (c) 2016 goliatone
Licensed under the MIT license.