localstorage-polyfill
in memory localStorage polyfill for node.js utilizing ES6 proxies
Last updated 10 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 (10 years ago)

5 Versions

  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.9.2                                ...           10 years ago
  • 0.9.1                                ...           10 years ago
  • 0.9.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 9
Last Day 0
Last Week 9
Last Month 1
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |