speedy.db
TypeScript icon, indicating that this package has built-in type declarations

8.0.0 • Public • Published

Nippy.db

Discord: Astpod#2019 Discord: Devily#2019 Nippy.db Test

const nippydb = require('nippy.db');

const db = nippydb('./nippydb.sqlite');

// Setting an object in the database:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }

// 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.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // ['Sword', 'Watch']

Package Sidebar

Install

npm i speedy.db

Weekly Downloads

3

Version

8.0.0

License

MIT

Unpacked Size

41.9 kB

Total Files

24

Last publish

Collaborators

  • astpod