Artia.db is a lightweight and efficient database library for Node.js.
You can install Artia.db via npm:
npm install artia.db
const { NoSQLDatabase } = require("artia.db");
const db = new NoSQLDatabase("mydata.json");
const newItem = {
name: "John",
age: 30,
};
db.create({ create: newItem });
const foundItem = db.findUnique({ where: { name: "John" } });
console.log(foundItem);
import { NoSQLDatabase } from "artia.db";
const db = new NoSQLDatabase("mydata.json");
const newItem = {
name: "John",
age: 30,
};
db.create({ create: newItem });
const foundItem = db.findUnique({ where: { name: "John" } });
console.log(foundItem);
NoSQLDatabase(fileName: string)
findUnique({ where: { field: value } }): T | null
where
: An object with criteria to match for finding the item.
deleteUnique({ where: { field: value } }): boolean
where
: An object with criteria to match for deleting the item.
update({ where: { field: value }, data: { field: value } }): T | null
where
: An object with criteria to match for updating the item.data
: An object with new data to update the item.
findMany({ where: { field: value } }): T[]
where
: An object with criteria to match for finding multiple items.
deleteMany({ where: { field: value } }): number
where
: An object with criteria to match for deleting multiple items.
create({ create: T }): T
create
: An object with data for creating a new item.
Feel free to contribute to this project! Please follow our Contribution Guidelines.
This project is licensed under the ISC License. See the LICENSE file for details.