littledatabase

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i littledatabase

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

1.74 kB

Total Files

3

Last publish

Collaborators

  • rusty778