⚠️ RobinDB is now deprecated. Because any update to the package would cause database resets, you should run db.get('*')
to access the entire database and save it elsewhere.
A quick database for Node.js
RobinDB is a quick database for Node.js. It is built on top of NeDB and meant to be a quicker and more reliable version of Quick.db. RobinDB also has a cloud server as well as a client. This package is for a local database.
const db = require('robindb');
db.set('money', 50).then(() => {
db.get('money').then(money => {
console.log(money); // 50
db.set('items', [
'sword',
'armor'
]).then(() => {
db.get('*').then(allItems => {
console.log(allItems); // { money: 50, items: [ 'sword', 'armor' ] }
});
});
});
});
If you're looking for a database that's:
- Lightweight and simple
- Easy to set up
- Lightning fast
- Cloud ready
- Key/value JSON-based
- 50x faster than Quick.db
...RobinDB is for you.
If you're looking for a database that's:
- Built for lots of data storage
- Has heavy permissions management
- SQL or NoSQL
...RobinDB is not for you.
Get a key in the database
key
- The key to get. If getting a key nested inside of objects, use dot notation. Required
returns Promise<any>
Set a key in the database
key
- The key to set. If setting a key nested inside of objects, use dot notation. Requiredvalue
- The value to set the key to. Required
returns Promise<Number>
Push a value to an array. The value at the specified key must be an array. RobinDB will not create an array for you.
key
- The key of the array to push to. If pushing to a key inside of objects, use dot notation. Requiredvalue
- The value to push to the array. Required
returns Promise<Number>
Delete a key from the database
key
- The key to delete. If deleting a key nested inside of objects, use dot notation. Required
returns Promise<Number>
Find if a key exists in the database
key
- The key to look for
returns Promise<Boolean>
Get the entire database
returns Promise<Object>
That's it! If you have any questions I'm YodaLightsabr#6565 on Discord.