Neoclassical Programming Multitude
Wondering what’s next for npm?Check out our public roadmap! »

@abmsourav/localdb

1.2.0 • Public • Published

LocalDB

LocalDB is a NodeJS CRUD API. It uses local file system for CRUD operation. It's a promise based API.



Installation

npm i @abmsourav/localdb


API

GET localDB.get()

POST localDB.set(jsonObject)

UPDATE localDB.update(jsonObject, newValue)

DELETE localDB.remove(jsonObject)


Uses

const {localDB} = require('@abmsourav/localdb');
const ldb = localDB();

const data = {names: "Sourav", email: "keramotul.islam@gmail.com"};

// add new data
ldb.set(data)
	.catch( (err) => console.log(err) );

// get data from localDB
ldb.get()
	.then( (data) => console.log(data) ) // [ {name: 'Sourav', email: 'keramotul.islam@gmail.com'} ]
	.catch( (err) => console.log(err) );

// update data
ldb.update({name: "Sourav"}, "Abm Sourav") // args: 1.where update'll made, 2.new value
	.catch( err => console.log(err) );

// Delete data
ldb.remove({name: "Abm Sourav"})
	.catch( err => console.log(err) );

Keywords

none

Install

npm i @abmsourav/localdb

DownloadsWeekly Downloads

178

Version

1.2.0

License

MIT

Unpacked Size

6.39 kB

Total Files

7

Last publish

Collaborators

  • avatar