1.0.0 • Published 5 years ago
@jswork/next-cookie v1.0.0
next-cookie
A simple, lightweight JavaScript API for handling browser cookies for next.
installation
npm install -S @jswork/next-cookieapis
| api | params | description |
|---|---|---|
| get | inKey | get single key cookey |
| gets | - | get all key cookey |
| set | inKey,inValue,inOptions | set cookie with options({ path:'/', expires: ''}) |
| sets | inObject,inOptions | set cookie with object; |
| del | inKey | del the key |
| dels | inArray | del keys |
| clear | - | del all cookies |
usage
import NxCookie from '@feizheng/next-cookie';
// code goes here:
NxCookie.get
NxCookie.gets
NxCookie.set
NxCookie.sets
NxCookie.del
NxCookie.dels
NxCookie.clearresources
- https://github.com/js-cookie/js-cookie
- http://www.w3school.com.cn/js/js_cookies.asp
- https://stackoverflow.com/que
license
Code released under the MIT license.
1.0.0
5 years ago