@nacho-cs/feather-db
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @nacho-cs/feather-db

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

6.3 kB

Total Files

4

Last publish

Collaborators

  • nacho-cs