1.0.4 • Published 6 years ago

@devkep/database-json v1.0.4

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

Json DB

Featherweight writing and reading to json files

Installation

npm i @devkep/database-json --save

Usage

import * as Database from 'jsondb';

var db = new Database("database-name");
// An empty database-name.json will be created 

db.push("MyTesting", {hello: "world"});
// Create "MyTesting" key and push an object to it

db.read("MyTesting"); 
/* => 

{ "hello": "world"}

*/


db.read(); 
// Read entire file
/* => 

"MyTesting": {
    "hello": "world"
}

*/

db.delete("MyTesting");
// Removes your "MyTesting" key

db.truncate();
// Wipes everything

db.unlink();
// Permanently deletes the file

Test

npm run test
1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago