# jwt-check-expiration

> Check to see if a token is expired using only the token itself without a secret key or validation

Latest version **1.0.5** (published 2020-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install jwt-check-expiration
pnpm add jwt-check-expiration
yarn add jwt-check-expiration
bun add jwt-check-expiration
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2020-08-15 |
| First published | 2020-08-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Charles Markovich |
| Maintainers | starscraperio |
| Keywords | jwt, json, web, token, decode, expiration, check, expiration, verify, jwt, expiration, verify, expires, exp, isexpired, expired |

## Links

- npm: https://www.npmjs.com/package/jwt-check-expiration
- Repository: https://github.com/star-scraper/jwt-check-expiration
- Homepage: https://github.com/star-scraper/jwt-check-expiration#readme
- Issues: https://github.com/star-scraper/jwt-check-expiration/issues
- npm.io page: https://npm.io/package/jwt-check-expiration

## Dependencies (1)

- [jwt-decode](https://npm.io/package/jwt-decode.md) ^2.2.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.5 (latest) — 2020-08-15
- 1.0.4 — 2020-08-15
- 1.0.3 — 2020-08-15
- 1.0.2 — 2020-08-15
- 1.0.1 — 2020-08-15
- 1.0.0 — 2020-08-15

## README

# jwt-check-expiration

## Purpose

Determine if a JWT is expired in the client without requiring a secret, this is for client use only and not intended for secure validation of the JWT. Only as a convenience method to avoid a network call if the JWT has indicated that it has expired.

## Installation

`npm install jwt-check-expiration`

## Usage

Determine if the JWT has expired in the client application when no validation is required and you do not want to expose the secret.

## Important

Only use this when security is not important, such as when you only want to save a network request before having to refresh a token.  In the event the JWT was modified and the expiration was invalid, the worst case scenario is that you will make an unnessary network request which should refresh the token anyways in your setup.

## Parameters

JWT Token

## Example

```js
import { isJwtExpired } from 'jwt-check-expiration';

console.log('isExpired is:', isJwtExpired('your-token-here'));
```

---
_Source: https://npm.io/package/jwt-check-expiration · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
