littledatabase
v1.0.1
Published
json database for small projects.
Downloads
6
Readme
littledatabase
Little Database is a json based db made for small projects, hence the name "littledatabase"
Getting started:
Install the package with npm:
npm i littledatabase
Now create a new db:
const littledatabase = require("littledatabase");
const db = new littledatabase.db("/path/to/json/file.json"); // make a new db.
// The given json file must have a default. For example: [], {}, or {users:[]}.
db.data[0] = "Hello World"; // Edit the data in json file. It is already parsed.
db.save(); // Save the new data into the json file. It will be stringified.
DB class
- db.path: path given on construction.
- db.data: file data. only updates real file when using
save
method. - db.save: method to save data to file.