0.1.3 • Published 5 years ago

jwt-plus v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

jwt

a simple instance for jwt.

Install

npm install jwt-plus

Usage

import {encode, decode} from 'jwt-plus'
const payload = {k: 1};
const token = encode(payload, secret);
const [isPass, parseValue] = decode(token, secret);
// [true, {k: 1, exp: XXX}]

Interface

Functions

encode(payload, secret, options) ⇒ string

jwt encode payload

Kind: global function
Export:

ParamType
payload*
secretstring
optionsObject

decode(token, secret) ⇒ Array

jwt decode token

Kind: global function
Returns: Array - Boolean, any
Export:

ParamType
tokenstring
secretstring

License

MIT

Copyright (c) 2019 蓝色的秋风