2.0.2 • Published 3 years ago

wynddb-mjs v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

WyndDB - ES6 Module

Are you tired of all those complex database systems like SQL and MongoDB that all have confusing syntax? Do you want a simple DB that is easy to use, yet powerful for small projects? Then this no-dependency library is the solution for you! It uses filesystem to write & read JSON to a file called wdb, and puts all data into separate modules with user specified names.

This too complex? Here's an example of WyndDB-mjs in use:

//Import the module's Connector class
import { Connector } from "wynddb-mjs";

//Create or Access the db
let connection = new Connector({
		name: 'users',
		file: './users.json'
}).then(async db => {
	await db.set('user1', {
		id: 1,
		name: 'test_user',
		verified: false
	});
	await db.update('user1', { verified: true });
	await db.get('user1') // returns { id: 1, name: "test_user", verified: true }
});

Documentation:

classes: Connector - The database connection object (doesn't hold the data)

<Connector>.connect({ name: String, file?: String }) - Connect to/create a db

<Connector>.get(key) - If there is a key, it will return the keys value, if not, it will return the db.

<Connector>.set(key, value) - add a key value pair to the db

<Connector>.delete(key) - If there is a key, it will delete the keys value, if not, it will delete the db.

<Connector>.filter(filter function) - filter stuff from a db

<Connector>.update(key, {JSON}) - update json values

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago