Smalldb is npm package meant for key-value storage.
- For storing the key as file and value as content in specific key file.
- Time To Live (TTL) based cache
- Supports the current active LTS version of Node.js or higher
Install smalldb
npm install --save @devansh5/smalldb
Create a new Smalldb instance , as default this intialize a default values for ttl and directory.
const Smalldb=require('@devansh5/smalldb')
const db=Smalldb({optionals})
-
you can pass default one Smalldb()
-
specifying directory in optionals,
-
Smalldb({dir:'root/src/index',ttl:1000})
// async function init(){
// await db.create('hello','namaste')
// await db.create()
// await db2.create('name',{firstname:'devansh',lastname:'chaubey'},1000)
// await db.read('hello')
// await db2.read('name')
//} //init();
read the specified key file from the data storage directory and returns it return the JSON value if it exist.
will create the new file with the name of key and the content as the value from the directories
will delete the key file from the directories
Package Link :=> Click Here