safronosejs
v0.0.4
Published
Database using QOL SQlite
Downloads
2
Readme
Safronose (QOL)
Safronose is a SQlite npm that uses the self-developed QOL entity. This database offers so many vantages, like persistent storage and so much more. Any issue contact me from Discord: Aidak#0001
Example
const db = require('safronosejs');
// Set an object
db.insert('key', 'value') // returns -> value
// Pushing an element to an array (that doesn't exist yet) in an object:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }
// Adding to a number (that doesn't exist yet) in an object:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
// Repeating previous examples:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
// Fetching individual properties
db.model('userInfo.balance') // -> 1000
db.get('userInfo.items') // ['Sword', 'Watch']
Installation
If you're having troubles installing, please follow this troubleshooting guide.
Linux & Windows
npm i safronosejs --save
Note: Windows users may need to do additional steps listed here.
Mac
- Install: XCode
- Run:
npm i -g node-gyp
in terminal - Run:
node-gyp --python /path/to/python2.7
(skip this step if you didn't install python 3.x) - Run:
npm i safronosejs --save