@zidnigz/fs-db

1.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @zidnigz/fs-db

Weekly Downloads

1

Version

1.2.0

License

ISC

Unpacked Size

5.58 kB

Total Files

3

Last publish

Collaborators

  • zidnigz