JSPM

easy-json-db

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 15
  • Score
    100M100P100Q35283F
  • License ISC

json file storage database

Package Exports

  • easy-json-db
  • easy-json-db/lib/index.js

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 (easy-json-db) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

easy-json-db

tests workflow

Simple to use JSON file system meant for discord bots. It was designed and built for small and prototype applications.

Typedocs

Breakdown

Features

  • Small and lightweight.
  • Typescript typings.
  • Easy to edit raw data.

Drawbacks

  • Not very performant
  • Minimal features
  • You pledge alliance to the JSON overlords.

Usage guide

Installation

npm install easy-json-db

Create a database, insert and read an object

const DBClient = require('easy-json-db');

const db = new DBClient();

const insertResult = db.insert('users', 'Klein', {
    admin: false,
});

if (!insertResult.ok) {
    console.error(insertResult.err);
}

if (insertResult.ok) {
    const getResult = db.get('users', 'Klein');

    const userData = getResult.some ? getResult.val : {};

    console.log(userData);
}