1.1.1 • Published 3 years ago

jwt-extractor v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 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

3 years ago

1.0.2

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.3.0

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.10

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago