Package Exports
- lw-db
- lw-db/dist/main.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lw-db) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Light Weight DataBase
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");Compatibility
Path:
- Supports only relative path (starts from active directory)
- Active directory
OS:
- Windows
- Linux
- Mac (no tested)
Etc:
- ES5
- ES6
- TypeScript support
Important notes
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'tThe active directory is static and defined in the constructor call.
const db = new DataBase("path/to/your/db/folder"); // supports both relative and absolute pathPros:
- Only kilobytes of ram required
- Easy to use
- Fully local
- Easy setup
- Uses relative path for shorter paths
Cons:
- Not advised for large scale projects
- Doesn't have complex DB calls like search or filter.
Disclaimer
THIS MODULE IS IN ACTIVE DEVELOPMENT! I AM NOT LIABLE IN ANY WAY FOR ANY OR FORM FOR ANY DATA LEAK OR DATA LOSS!