jsondb

1.0.0 • Public • Published

Simple database for storing JSON to disk.

Install

npm install jsondb

Usage

const createDB = require('jsondb');
 
const db = createDB('db', '.txt');
 
db.put('level1', {
    name: "Level One", map: [
        0, 0, 0, 0,
        0, 1, 2, 0,
        1, 1, 1, 1
    ],
    attachment: "This goes in a different file",
}, (err) => {
    if (err) throw err;
    console.log("level1 saved.")
 
    db.get('level1', (err, data) => {
        if (err) throw err;
        console.log('level 1 loaded', data);
    });
});

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i jsondb

      Weekly Downloads

      11

      Version

      1.0.0

      License

      ISC

      Unpacked Size

      8.22 kB

      Total Files

      7

      Last publish

      Collaborators

      • creationix