Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashiknesin/is-jwt
Determine if a string is JSON Web Token ( JWT)
https://github.com/ashiknesin/is-jwt
Last synced: 5 days ago
JSON representation
Determine if a string is JSON Web Token ( JWT)
- Host: GitHub
- URL: https://github.com/ashiknesin/is-jwt
- Owner: AshikNesin
- License: mit
- Created: 2017-01-04T09:10:28.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-13T04:21:59.000Z (about 6 years ago)
- Last Synced: 2024-11-11T22:15:32.507Z (5 days ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# is-jwt [![Build Status](https://travis-ci.org/HugeThoughts/is-jwt.svg?branch=master)](https://travis-ci.org/HugeThoughts/is-jwt) [![Coverage Status](https://coveralls.io/repos/github/HugeThoughts/is-jwt/badge.svg?branch=master)](https://coveralls.io/github/HugeThoughts/is-jwt?branch=master)
> Determine if a string is JSON Web Token (JWT)
## Install
```
$ npm install --save is-jwt
```## Usage
```js
const isJWT = require('is-jwt');const VALID_JWT = 'eyJhbGciOiJIUzI1NiIsImV4cCI6MTQ5MzE3NDkxMCwiaWF0IjoxNDgyMzk3OTEwfQ.eyJyb2xlIjoiZW1wbG95ZXIiLCJpZCI6MiwiZW1haWwiOiJhc2hpa0BuZm5sYWJzLmluIn0.ICtMwjrhg4KbQjPJBWd29O4KRogNdjQj8bOhUrvYlLw';
isJWT(VALID_JWT);
//=> 'true'
```## API
### isJWT(token)
#### token
Type: `string`
A valid JWT token
## License
MIT © [Ashik Nesin](https://github.com/HugeThoughts/is-jwt)