JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q24793F
  • License MIT

Another Local JSON Database

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (geardb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    Another Local JSON Database

    GitHub license GitHub stars GitHub forks GitHub issues GitHub pull requests

    First of all, thank you for using thegears/geardb

    How to use

    Install

    npm install geardb

    Usage

    // ES6
    import GearDB from 'geardb';
    // CommonJS
    const GearDB = require('geardb');
    
    const db = new GearDB("db.json"); // path to db.
    
    db.set("key", "value");
    
    console.log(db.get("key")); // log 'value'
    
    db.push("list", "value");
    
    console.log(db.get("list")); // log ['value']
    
    db.pull("list", "value");
    
    // -- OR --
    
    db.pull("list", 0);
    
    console.log(db.get("list")); // log []
    

    You can use set, push, pull with await. (This way is recommended.)