@sineverba/jwt-decoder
TypeScript icon, indicating that this package has built-in type declarations

1.4.2 • Public • Published

JWT decoder

CI / CD Status
NPM npm version
Semaphore CI Build Status
Circle CI CircleCI
Coverall Coverage Status
SonarCloud Quality Gate Status

jwt-decoder decodes a JWT Token as an object.

Installation

npm install @sineverba/jwt-decoder

Usage

import { parseJwt } from "@sineverba/jwt-decoder";
const token =
    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";

const parsedToken = parseJwt(token);
console.log(parsedToken); // returns {"sub": "1234567890", "name": "John Doe", "iat": 1516239022};

Tests

npm run test for simple test

npm run cover for coverage

Readme

Keywords

Package Sidebar

Install

npm i @sineverba/jwt-decoder

Weekly Downloads

1

Version

1.4.2

License

MIT

Unpacked Size

4.71 kB

Total Files

5

Last publish

Collaborators

  • sineverba