1.3.2 • Published 2 years ago

@enzon3/txtdb v1.3.2

Weekly downloads
-
License
GPL-3.0-or-later
Repository
github
Last release
2 years ago

txtdb GitHub npm GitHub package.json dynamic npm bundle size

logo

txtdb is a simple key-based database based on text files formatted in a special way.

Features

Key-based
Simple
Fast
Easy to use
Cache
Up to 2000 keys

Installation

Use the package manager npm to install txtdb.

npm i @enzon3/txtdb

Usage

Setup up txtdb

The second parameter is a boolean for whether or not to overwrite already existing keys.

const settings = {
    dbFile: '[db file location here].txt',
    allowOverwrite: true,
    delimiter: 'any delimiter you want, for example: "|"',
    enableCache: false
}
db.setup(settings);

Get a value

async function getKey(key) {
    const value = await db.getKey(key);
    return value;
}

var key = getKey('key');
// do something with key

Set a value

Quick warning, if the AllowOverwrite flag in the setup function is set to true, and if there was a key of the same name before, this command would overwrite it.

db.setKey('key', 'value');

Delete a value

db.deleteKey('key');

Contributing

Please don't request for write access to the repository, instead, fork the repository and open a PR describing what you would like to change in depth.

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.5

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago