1.0.0 • Published 5 years ago

@jswork/next-local-expires v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

next-local-expires

LocalStorage which can be set expires.

version license size download

installation

npm install -S @jswork/next-local-expires

apis

apiparamsdescription
setinKey, inValue, inExpiresset 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.