Easy DB
Lite&easy database for the same interface for all JavaScript environments. The same interface can be used in Node, Web, Mobile, Cloud, Server and Develop applications.
This database is NoSQL, intended for developing and for less complex production structures.
- Not create any database structure, just use it. With the first called line in code the db is create itself.
- Whole content is easy readable and editable in JSON structure.
- Handling files directly in easy-db.
Name | npm |
---|---|
Core | npm install easy-db-core |
Node | npm install easy-db-node |
Browser | npm install easy-db-browser |
React native | npm install easy-db-react-native |
Client | npm install easy-db-client |
Server | npm install easy-db-server or run npx easy-db-server |
Google Cloud | npm install easy-db-google-cloud |
Include types for TypeScript.
API interface
import easyDB from "easy-db-*";
const { insert, select, update, remove, file } = easyDB(conf);
// INSERT
const idOfRow = await insert("collection1", { myRow: 1 });
const idOfRow = await insert("collection1", (id) => ({ id, myRow: 1 }));
// SELECT
const allCollection1 = await select("collection1");
const myRow1 = await select("collection1", idOfRow);
// UPDATE
await update("collection1", idOfRow, { ...myRow1, update: 1 });
// REMOVE
await remove("collection1", idOfRow); // only one row
// INSERT FILE
const idOfRow = await insert("collection1", { photo: file("data:base64...") });
// saved { photo: { url: "http://..." } }