localstorage-polyfill

1.0.1 • Public • Published

localstorage-polyfill

in memory localStorage polyfill for node.js utilizing ES6 proxies

Installation

npm i localstorage-polyfill -D

Saving for development, because primarily this package is meant for unit testing browser in node.js.

Usage

require('localstorage-polyfill')
// or
import 'localstorage-polyfill'
global.localStorage // now has your in memory localStorage

For API doc, refer to MDN.

There are other packages like node-localStorage, but none of them work properly when you do

localStorage.c = 1

They only shim the methods of localStorage object, they don't imitate it's behaviour fully.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    27,562
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    27,562
  • 1.0.0
    6
  • 0.9.2
    1
  • 0.9.1
    1
  • 0.9.0
    3

Package Sidebar

Install

npm i localstorage-polyfill

Weekly Downloads

16,717

Version

1.0.1

License

MIT

Last publish

Collaborators

  • capaj