polyfill-localstorage-node

in memory localStorage polyfill for node.js utilizing ES6 proxies

Usage no npm install needed!

<script type="module">
  import polyfillLocalstorageNode from 'https://cdn.skypack.dev/polyfill-localstorage-node';
</script>

README

localStorage-node

GitHub license npm version

in memory localStorage polyfill for node.js utilizing ES6 proxies.

Installation

npm i polyfill-localstorage-node -D

Tests

npm run test

Usage

require('polyfill-localstorage-node')

// or

import 'polyfill-localstorage-node'
global.localStorage // now has your in memory localStorage

For API doc, refer to MDN.

Direct assignment works, thanks to ES6 proxies

localStorage.c = 1