@jswork/next-local-expires
v1.0.0
Published
LocalStorage which can be set expires.
Readme
next-local-expires
LocalStorage which can be set expires.
installation
npm install -S @jswork/next-local-expiresapis
| api | params | description | | --- | ------------------------- | --------------------------------------------------- | | set | inKey, inValue, inExpires | set value with expires (ms) | | get | - | get the right value if is in time, or will get null |
usage
import NxLocalExpires from '@feizheng/next-local-expires';
// code goes here:
const store = new NxLocalExpires();
store.set('login',{ token: 'YWRmajEyMzMx' }, 5*24*60*60*1000)
store.get('login');
// { token: 'YWRmajEyMzMx' }license
Code released under the MIT license.
