lw-db
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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'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

Pros:

  • 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!

Package Sidebar

Install

npm i lw-db

Weekly Downloads

9

Version

1.0.3

License

ISC

Unpacked Size

28.6 kB

Total Files

7

Last publish

Collaborators

  • 37o1