1.1.1 • Published 5 years ago

jwt-extractor v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Readme

About

This is a module which allows for a payload or individual properties of a payload to be extracted from a Base64 encoded JWT token.

Installation

npm i jwt-extractor

Use as a function

Use one of the following functions to retrieve the payload or a payload property.

import { payloadProperty, payload } from "jwt-extractor";

payload(token) // => payload | undefined
payloadProperty(token, 'propertyName') // => property | undefined

Use as a Class

Could be useful if you want to return to the class to retrieve something from the payload/the payload itself again in the future without having to re-decode the token.

import { TokenDecoder } from "jwt-extractor";

const Decoder = new TokenDecoder(token)

Decoder.getPayload() // => payload | undefined
Decoder.getProperty(propertyName) // => property | undefined
Decoder.setToken(token) // sets a new token
1.1.1

5 years ago

1.0.2

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago

0.0.10

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago