# jwt-token-utility

> JWT authentication utility

Latest version **1.0.0** (published 2022-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install jwt-token-utility
pnpm add jwt-token-utility
yarn add jwt-token-utility
bun add jwt-token-utility
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-09-15 |
| First published | 2022-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.9 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Dave Victoria |
| Maintainers | _davic64 |
| Keywords | jwt, auth, authentication, token, jsonwebtoken |

## Links

- npm: https://www.npmjs.com/package/jwt-token-utility
- Repository: https://github.com/davic64/jwt-token-utility
- Issues: https://github.com/davic64/jwt-token-utility/issues
- npm.io page: https://npm.io/package/jwt-token-utility

## Dependencies (1)

- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.5.1

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-09-15

## README

# JWT Token Utility

It is a utility that seeks to save a few lines of code when generating a token and decoding it using [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken).

## Install

```
$ npm install jwt-token-utility
```

## Usage

For create a token

```javascript
import { createToken } from "jwt-token-utility";

const token = createToken({ id: 2, name: "user" }, "SECRET_KEY", "2d");
```

For verify token

```javascript
import { verifyToken } from "jwt-token-utility";

try {
  verifyToken("TOKEN", "SECRET_KEY");
} catch (err) {
  console.log(err.message);
}
```

## Author

[Davic64](https://github.com/davic64)

## Licence

This project is licensed under the MIT license. See the [LICENSE](LICENCE) file for more info.

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