is-jwt
v1.0.0
Published
Determine if a string is JSON Web Token (JWT)
Downloads
3
Readme
is-jwt
Determine if a string is JSON Web Token (JWT)
Install
$ npm install --save is-jwt
Usage
const isJWT = require('is-jwt');
const VALID_JWT = 'eyJhbGciOiJIUzI1NiIsImV4cCI6MTQ5MzE3NDkxMCwiaWF0IjoxNDgyMzk3OTEwfQ.eyJyb2xlIjoiZW1wbG95ZXIiLCJpZCI6MiwiZW1haWwiOiJhc2hpa0BuZm5sYWJzLmluIn0.ICtMwjrhg4KbQjPJBWd29O4KRogNdjQj8bOhUrvYlLw';
isJWT(VALID_JWT);
//=> 'true'
API
isJwt(input, [options])
input
Type: string
A valid JWT token
License
MIT © Ashik Nesin