@nacho-cs/feather-db
v1.0.1
Published
barebones .json database utility library
Downloads
5
Readme
feather-db
methods:
- init (create a new database)
- query (takes in a key value pair pair and returns the first element that has includes the value)
- exactQuery (same thing as query but the value must match exactly)
- queryById (find an object based on an id)
- add (add a new object)
- insert (find an object based on an id and replace the value of the key provided)
- remove (remove an object based on its id)
- count (gives the amount of objects in the database)
utility methods:
- read (read the entire database)
- id (generates an id)
example:
import DB from "@nacho-cs/feather-db";
const db = new DB().init();
const user = {
name: "nacho-cs",
age: 15,
from: "United States",
};
await db.add(user);
console.log(await db.query({ from: "United" }));
// [{
// name: "nacho-cs",
// age: 15,
// from: "United States",
// };