1.3.1 • Published 11 months ago

local-storage-poorlyfill v1.3.1

Weekly downloads
3
License
MIT
Repository
github
Last release
11 months ago

local-storage-poorlyfill

example workflow Known Vulnerabilities js-standard-style semantic-release

In-memory polyfill for local storage

Add to your project:

npm i local-storage-poorlyfill

<script type="text/javascript" src="node_modules/local-storage-poorlyfill/dist/local-storage-poorlyfill.js"></script>
<script>
// use _localStorage
</script>

Why?

  • For local files, IE and Edge do not have support for local storage

  • local storage can be disabled

Tested browsers

  • Chrome, Firefox, Internet Explorer, Edge, Safari and Opera

Implementation details

  • Use browser's native implementation if supported

  • Mirror native functionality with an object

Implementation flaws

  • Not persistent

  • Need to use _localStorage instead of localStorage

Scripts

Lint with standard:

yarn lint

Transpile with babel:

yarn build

Run unit tests:

yarn test

Use _localStorage or window._localStorage instead of localStorage or window.localStorage because the browser prevents using localStorage or window.localStorage if access is denied for this document.

W3 Spec:

MSDN:

1.3.1

11 months ago

1.3.0

3 years ago

1.2.10

3 years ago

1.2.8

5 years ago

1.2.7

6 years ago

1.2.6

6 years ago

1.2.5

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.8

6 years ago

1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago