g-storage
v1.0.9
Published
this is storage libiary tools.
Downloads
1
Readme
g-storage
this is storage libiary tools.
use
- download package
npm i g-storage
or cdn
<script src="https://unpkg.com/[email protected]/dist/gstorage.js"></script>
- import package
npm i -S g-storage
import stor from 'g-storage';
- localSotrage and sessionStorage set
stor.setItem(window, 'userId', Date.parse(new Date()));
stor.setItem(window, 'userName', 'admin');
console.log(stor.getItem(window, 'userId'));
stor.rmItem(window, 'userName');
stor.clearItem(window);
- cookie set
stor.setCookie(window, 'username', '123', 60*60*24*7);
stor.getCookie(window, 'username');
stor.rmCookie(window, 'username');
publish log
- 1.0.6 reconfig code
- 1.0.5 fix someone bug
- 1.0.4 fix cookie bug
- 1.0.3 add cookie set methods
- 1.0.2 fix bug
- 1.0.1 add sessionStorage methods
- 1.0.0 add localStorage methods