1.3.0 • Published 2 years ago

local-storage-poorlyfill v1.3.0

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years 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.0

2 years ago

1.2.10

2 years ago

1.2.8

4 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago