Event based, key value store on the file system. Basic server side db in js for node developers. Geared towards NodeBots/IoT.
#### Event Based Key Value Store:
Made to store hardware data on the filesystem!
Installation:
npm install selfup-rejs --save
Warning
This was built with node v14.4.0
Ensure your data is safe and not in version control:
echo 'selfup-rejs/*' >> .gitignore
Load package:
``js`
const Rejs = require('selfup-rejs');
const rejs = new Rejs();
Official DOCS:
Documentation: right here!
Raspberry Pi
NodeBots/JohnnyFive and logging event data: Repo
Arduino
NodeBots/JohnnyFive and logging event data: Repo
Using RESTful verbs to help explain from a high level what is happening.
This is not a server.
This is a database that writes and reads files on the server.
Verbs/Methods
- (POST) Create a table: rejs.createTable('tablename')rejs.createTables('one', 'two', 'three')
- (POST) Create Multiple Tables: rejs.newData('tablename', dataObject)
- (POST) Add data to table:
- (POST) Add data to Multiple Tables:
`js`
rejs.newDatas(
['firstTable', { test: 'data' }],
['secondTable', { test: 'data' }],
['thirdTable', { test: 'data' }],
);
- (DELETE) Delete data by ID in a table: rejs.deleteById('tablename', '2')rejs.dropTable('tablename')
- (DELETE) Drop a table: rejs.dropTables('firstTable', 'secondTable')
- (DELETE) Multi-Table Drop: rejs.updateTable('tablename', dataObject)
- (PUT) Replace/Overwrite a table:
- (PUT) Replace/Overwrite Multiple tables:
`js`
rejs.updateTables(
['firstTable', { test: 'new data' }],
['secondTable', { test: 'new data' }],
['thirdTable', { test: 'new data' }],
);
- (GET) Table Object Query: rejs.getTable('tablename')rejs.getTables('table', 'table2', 'table3')
- (GET) Multi-Table Query: rejs.findId('tablename', 'id')
- (GET) Find by ID: rejs.where('tablename', 'any value in a flat object')
- (GET) Where/Select:
#### JohnnyFive/NodeBots/IoT
- Store temperature data over time
- Store how many times a door has been opened
- Store telemetry data
- Store Data on a Raspberry Pi
- Store Data on a server hooked up to an Arduino
- Store Data on an Arduino Yun/BeagleBone/etc...
- Many possibilities for IoT
#### Electron OSX/Windows Apps
- Store file paths to load files needed on load
- Store small notes for a twitter like notes app
- Store image url's
- Store any data that you need to persist from app shutdown back to open
#### VPS
- Use it as a small DB for a low volume production app
- Use it to get quickly set up, and then move on to Mongo/Postgres once your app is mature and MVP is proven
#### To get 100% coverage:
If the selfup-rejs folder is in your directory:
`sh`
npm install
rm -rf selfup-rejs
Then you can run:
./node_modules/.bin/istanbul cover _mocha
Now the selfup-rejs folder will be in your directory again!

#### To run tests without coverage:
npm test`