1.1.1 • Published 4 years ago

@feizheng/next-local-expires v1.1.1

Weekly downloads
3
License
MIT
Repository
-
Last release
4 years ago

next-local-expires

LocalStorage which can be set expires.

installation

npm install -S @feizheng/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' }