1.0.7 • Published 2 years ago
soul.db v1.0.7
soul.db
soul.db is a node.js database like quick.db.
Installation
npm link: click here.
npm install soul.db
Usage
//require the database
const database = require('soul.db')
const db = new database('test')
//set the database name and the database to use
db.setDatabase(`name_test`)
//or you can use terminateDB to delete all the db
db.terminateDB()
-⚠ Warning: do not use it if you don't know how it's works⚠
//expected output:
undefined
//db set name and value
db.set('name_test', 'hello world!')
//db get the value and console.log it
console.log(db.get('name_test'))
//expected output:
hello world!
//db push name and value
db.push('name_test', 'hello world! 2')
//expected output:
['hello world!', 'helloword! 2']
//db delete all, including name and value
db.delete('name_test')
//expected output:
undefined
//db json the name and value
console.log(db.json('name_test'))
//expected output:
{ name: 'name_test', data: 'hello world'}
//db array the value (not pushing db)
db.array('name_test')
//expected output:
['hello world!']
//db deleteData used to deleting the value
db.deleteData(`name_test`)
//expected output:
undefined