0.2.0 • Published 3 years ago

kvfiledb v0.2.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

kvfiledb

key-value file database with ttl. it's more like key-value document database but saved as a file per key-value pair.

install

npm i kvfiledb

usage

import { KVF } from 'kvfiledb'

const kvf = new KVF()
kvf.set('key', data, 1000)
kvf.get('key')
kvf.clear('key')
kvf.clearAll()

features

  • save primitive types
  • save json type
  • save non primitive types

supported non primitive types

  • Date
  • Buffer
  • Uint8Array

note on non primitive types

if you have

const data = new Date()
kvf.set('key', data)

it will be saved as

"Date|2022-04-26T04:50:15.171Z"

you don't need to parse it. this package will do it for you

const getData = kvf.get('key') as Date // this is a Date type regardless you do type cast or not
0.1.0

3 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.4

3 years ago

0.0.5

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.0

3 years ago