localstorage-polyfill
in memory localStorage polyfill for node.js utilizing ES6 proxies
Last updated 5 years ago by capaj .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install localstorage-polyfill 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.0.1                                ...           latest (5 years ago)

5 Versions

  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.9.2                                ...           5 years ago
  • 0.9.1                                ...           5 years ago
  • 0.9.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 7
This Week 15
This Month 92
Last Day 8
Last Week 56
Last Month 337
Dependencies (0)
None
Dev Dependencies (2)

Copyright 2014 - 2021 © npmmirror.com |