1.1.2 • Published 3 years ago

data-base-node v1.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Simple data base local with JSON file

npm i node-data-base

or (case you have yarn):

yarn add node-data-base
const startNodeDataBase = require('node-data-base')

const db = startNodeDataBase()
const dbBooks = db.tryLoad('books').orStartWith([])

dbBooks.setValue(v => [...v, { autor: 'platão', sells: 10000 }])

dbBooks.setValue(v => v.map(v => ({ ...v, sells: 99999 })))

dbBooks.save()

console.log(dbBooks.value())

if you want to change the root path use this:

const startNodeDataBase = require('node-data-base')

const db = startNodeDataBase({ rootPath: 'dataBase' })
1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago