easy-json-database
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

Easy Json Database

This database is used for the Scratch For Discord project.

Example

const Database = require("easy-json-database");
const db = new Database("./some-database.json", {
    snapshots: {
        enabled: true,
        interval: 24 * 60 * 60 * 1000,
        folder: './backups/'
    }
});

// Set data
db.set("Hello", "World");

// Get data
db.get("Hello"); // World

// Delete data
db.delete("Hello");

db.get("Hello"); // undefined
db.has("Hello"); // false

db.set("age", 10);
db.add("age", 1); // 11
db.subtract("age", 9); // 2

db.set("array", [ "apple" ]);
db.push("array", "orange"); // [ "apple", "orange" ]

// Clear data
db.clear();

// Get all the data
db.all();

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.5.1
    169
    • latest

Version History

Package Sidebar

Install

npm i easy-json-database

Weekly Downloads

222

Version

1.5.1

License

MIT

Unpacked Size

7.25 kB

Total Files

7

Last publish

Collaborators

  • androz2091