CI / CD | Status |
---|---|
NPM | |
Semaphore CI | |
Circle CI | |
Coverall | |
SonarCloud |
jwt-decoder
decodes a JWT Token as an object.
npm install @sineverba/jwt-decoder
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};
npm run test
for simple test
npm run cover
for coverage