1.0.0 • Published 7 years ago

is-jwt v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

is-jwt Build Status Coverage Status

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