localstorage-ponyfill
Universal LocalStorage ponyfill library for browser and Node.js.
Install
Install with npm:
npm install localstorage-ponyfill
Usage
Auto(Browser or Node.js)
Automatically select mode.
;const localStorage = ;localStorage;const value = localStorage;assert;
Browser
Native localStorage.
;const localStorage = ;
Node.js
Store data to <app-root>/.cache/localstorage-ponyfill/*
by default.
You can setting the path by storeFilePath
option.
;const localStorage = ;
In memory
;const localStorage = ;
API
Same with Window.localStorage
Changelog
See Releases page.
Running tests
Install devDependencies and Run npm test
:
npm i -d && npm test
Contributing
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu