@jswork/next-local-expires

1.0.0 • Public • Published

next-local-expires

LocalStorage which can be set expires.

version license size download

installation

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

apis

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.

Package Sidebar

Install

npm i @jswork/next-local-expires

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

6.63 kB

Total Files

5

Last publish

Collaborators

  • afeiship