1.0.4 • Published 1 year ago

easy-json-db v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

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);
}
1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago