a lightweight library for projects that allow you to work with local and session storage.
npm install simple-storage-tools --saveyarn add simple-storage-toolsbower install simple-storage-tools --save
first, you must import it.
var Storage = Storage;
then you can use it like this:
// it will store `json` as an session storageStorage.set'some-storage', json;// it will store `json` as an local storageStorage.set'some-storage', json, true;// it will get storage from sessionStorage Object;// it will get storage from localStorage Object// let r = Storage.get('some-storage', true);console.logr.value1 + ' ' + r.value2; // print Hello World in console
you can see more examples here
npm run test
feel free to fork and do what ever you want (or send pull requests).
for contribute this project, first clone the project and go to project folder:
git clone https://github.com/MetaiR/simple-storage-tools.gitcd simple-storage-tools
after that you ready to go :D