1.0.3 • Published 6 years ago
@feizheng/next-cookie v1.0.3
next-cookie
A simple, lightweight JavaScript API for handling browser cookies for next.
installation
npm install -S @feizheng/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.clear