ableat-packrat
v0.0.2
Published
Stream logs over mqtt
Downloads
2
Readme
How to use
Install
npm install ableat-packrat --save
Initialize
Tip: There's a working example in the docs
directory.
const PackRat = require('ableat-packrat')
const paths = [
'/path/to/file'
]
const packrat = new PackRat(paths, 12)
packrat.init((err, obj) => {
if (err) {
console.log(err, err.stack)
return
}
console.log(JSON.stringify(obj))
})
In this example obj
is expected to return:
{
"properties": {
"path": "/path/to/file",
"time": 1519324145
},
"data": [
"We're no strangers to love",
"You know the rules and so do I",
"A full commitment's what I'm thinking of",
"You wouldn't get this from any other guy",
"I just wanna tell you how I'm feeling",
"Gotta make you understand",
"Never gonna give you up",
"Never gonna let you down",
"Never gonna run around and desert you",
"Never gonna make you cry",
"Never gonna say goodbye",
"Never gonna tell a lie and hurt you"
]
}
Development
Setup
To clone and run this application, you'll need Git and nvm (which installs Node.js and npm) installed on your computer. From your command line:
nvm use
npm install
Testing
The following command creates a pseudo log that packrat can be tested against.
./docs/generateSampleLog.sh
Linting
Before commiting be sure to run the following command:
npm run eslint