jwt
a simple instance for jwt.
Install
npm install jwt-plus
Usage
const payload = k: 1;const token = ;const isPass parseValue = ;// [true, {k: 1, exp: XXX}]
Interface
Functions
- encode(payload, secret, [options]) ⇒
string
jwt encode payload
- decode(token, secret) ⇒
Array
jwt decode token
string
encode(payload, secret, [options]) ⇒ jwt encode payload
Kind: global function
Export:
Param | Type |
---|---|
payload | * |
secret | string |
[options] | Object |
Array
decode(token, secret) ⇒ jwt decode token
Kind: global function
Returns: Array
- [Boolean, any]
Export:
Param | Type |
---|---|
token | string |
secret | string |
License
MIT
Copyright (c) 2019 蓝色的秋风