pb7.db
v1.0.1
Published
Um simples banco de dados em sqlite com o foco em performance e simplicidade.
Downloads
5
Maintainers
Readme
Example
const playboy7 = require('pb7.db');
const db = playboy7();
// Configurando um objeto no banco de dados:
db.set('userInfo', { difficulty: 'Easy' })
// -> { difficulty: 'Easy' }
// Empurrando um elemento para uma matriz (que ainda não existe) em um objeto:
db.push('userInfo.items', 'Sword')
// -> { difficulty: 'Easy', items: ['Sword'] }
// Adicionando a um número (que ainda não existe) em um objeto:
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword'], balance: 500 }
// Repetindo exemplos anteriores:
db.push('userInfo.items', 'Watch')
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 500 }
db.add('userInfo.balance', 500)
// -> { difficulty: 'Easy', items: ['Sword', 'Watch'], balance: 1000 }
// Buscando propriedades individuais
db.get('userInfo.balance') // -> 1000
db.get('userInfo.items') // ['Sword', 'Watch']
Installation
npm i pb7.db