1.3.3 • Published 1 year ago

jsondbnode v1.3.3

Weekly downloads
2
License
ISC
Repository
github
Last release
1 year ago

Simple database made with JSON.

Install

npm install jsondbnode

Limitations

  • You may have problems with create and edit at the same time.
  • There is no backup, if the db.json get corrupted it's over

Usage

var DB = require("jsondbnode");
const Books = DB.model // example model
const DBCONFIG = DB.manager

// set DB.json path
DBCONFIG.configDB({ dbPath: "./db.json" }) 

// delete all data from DB.json
DBCONFIG.resetDB().then(console.log).catch(console.error)

new Books({
    name: "The lord of the rings",
    create_at: new Date(1954, 6, 28)
}).save().then((newBook) => {
    console.log(newBook)
    newBook.create_at = new Date(1954, 6, 29)
    newBook.save().then(console.log).catch(console.error)
}).catch(console.error)

Se more at Example

1.3.3

1 year ago

1.2.3

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago