1.1.3 • Published 2 years ago

nodeforage v1.1.3

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

nodeForage

Lightweight nodeJS equivalent of localForage, using JSON file.

Install

npm install nodeforage

Usage

  const { NodeForage } = require('nodeforage');
  const nodeforage = new NodeForage({name:'users'});
  
 
  await nodeforage.setItem('John', {password:'notsupersecure', username:'John', email:'john@doe.fr'});
  const johnUser = await nodeforage.getItem('John')
  const findHim = await nodeforage.findItem({email:"john@doe.fr"}); 

getItem

nodeforage.getItem(key)

  • key - Key to fetch

setItem

nodeforage.setItem(key, value)

  • key - Key under which storing
  • value - Object to store

FindItem

nodeforage.findItem(searchParams)

  • searchParams - Object of element to match

Next

It is planned to load locally and then deal with the filesystem changes, but for now, it's constant read/write.