1.2.0 • Published 1 year ago

@zidnigz/fs-db v1.2.0

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

FileSystem Database

An database system with fs, simple and powerfull.

Instalation

Use the package manager npm or yarn to install this libary. I use yarn for example.

yarn add @zidnigz/fs-db

Usage

const SimpleDb = require("fs-db");
var db = new SimpleDb("./database"); //make folder database

var userCollections = db.collection("user"); //create folder collection with a name user in folder database

let user = {
  name: "John Doe",
  age: 29,
};
let update = {
  name: "Ani Wilson",
  age: 22,
};

userCollection.insert(user); // Make file in folder user
userCollection.update({ age: 29 }, update); //Update databae
userCollection.find({}); // find all data in collection user
/* Output
[{
    name: "Ani Wilson",
    age:22
}]
*/
userCollection.findOne({ age: 22 }); // find data in userCollection based on age
/*Output
{
    name: "Ani Wilson",
    age:22
}
*/

userCollection.remove({ age: 22 }); // Delete database each variabel age

Thanks

1.2.0

1 year ago

1.1.0

1 year ago