1.0.1 • Published 12 months ago

@nacho-cs/feather-db v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

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",
// };
1.0.1

12 months ago

1.0.0

1 year ago