local-json-store

1.0.9 • Public • Published

local-json-store

Installation

npm install local-json-store

Usage

const JSONStorage = require('./index').JSONStorage;
const js = new JSONStorage('./test');
js.setItem('testKey', {'aaa': 'bbb'});
console.log(js.getItem('testKey')['aaa']);

Fully implements the localStorage specfication including:

  • All methods
    • length
    • setItem(key, value)
    • getItem(key)
    • removeItem(key)
    • key(n)
    • clear()
  • Serializes to disk in the location specified during instantiation
  • Associative array jsonStorage['myKey'] = 'myValue' and dot property jsonStorage.myKey = 'myValue'

Readme

Keywords

none

Package Sidebar

Install

npm i local-json-store

Weekly Downloads

0

Version

1.0.9

License

ISC

Unpacked Size

20.8 kB

Total Files

5

Last publish

Collaborators

  • polarbearzz