Simple Storage
a lightweight library for projects that allow you to work with local and session storage.
Installation
npm install simple-storage-tools --saveyarn add simple-storage-toolsbower install simple-storage-tools --save
Usage
first, you must import it.
Javascript
var Storage = Storage;
TypeScript
;
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
Test
npm run test
Contribute
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
then run:
npm install
after that you ready to go :D