lw-db
is a basic node:fs wrapper for easier file and data management
ES5
const DataBase = require("lw-db");
const db = new DataBase("path/to/your/db/folder");
ES6
import DataBase from "lw-db";
const db = new DataBase("path/to/your/db/folder");
Path:
- Supports only relative path (starts from active directory)
- Active directory
OS:
- Windows
- Linux
- Mac (no tested)
Etc:
- ES5
- ES6
- TypeScript support
When passing a path do not start your path with a .
or /
unless you want to do ..
.
The active directory system automatically appends /
to the end of the active directory.
Example:
db.readSync("some-folder/some-file"); // do
db.readSync("some-file"); // do
db.readSync("/some-file"); // don't
db.readSync("C:\\some-folder"); // don't
The active directory is static and defined in the constructor call.
const db = new DataBase("path/to/your/db/folder"); // supports both relative and absolute path
- Only kilobytes of ram required
- Easy to use
- Fully local
- Easy setup
- Uses relative path for shorter paths
- Not advised for large scale projects
- Doesn't have complex DB calls like search or filter.
THIS MODULE IS IN ACTIVE DEVELOPMENT! I AM NOT LIABLE IN ANY WAY FOR ANY OR FORM FOR ANY DATA LEAK OR DATA LOSS!