# yl-jwt

> Easy jwt tools.

Latest version **1.0.3** (published 2019-10-22) · ISC license · 0 weekly downloads

## Install

```sh
npm install yl-jwt
pnpm add yl-jwt
yarn add yl-jwt
bun add yl-jwt
```

## 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.3 |
| Published | 2019-10-22 |
| First published | 2019-09-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | yuri2 |
| Maintainers | yuri2 |

## Links

- npm: https://www.npmjs.com/package/yl-jwt
- Repository: https://github.com/yuri2peter/yl-jwt
- Homepage: https://github.com/yuri2peter/yl-jwt#readme
- Issues: https://github.com/yuri2peter/yl-jwt/issues
- npm.io page: https://npm.io/package/yl-jwt

## Recent versions

- 1.0.3 (latest) — 2019-10-22
- 1.0.2 — 2019-09-19
- 1.0.1 — 2019-09-19
- 1.0.0 — 2019-09-19

## README

# yl-jwt

Simplified version of JWT.

# Usage

```javascript
const { jwtResolve, jwtGenerate } = require('yl-jwt');

const data = 'test'; // any data that can be serialized
const cert = 'key'; // secrets
const expire = 2; // expired in 2s
const jwt = jwtGenerate(data, cert, expire);

setTimeout(() => {
  const rel1 = jwtResolve(jwt, cert);
  console.log('1: ' + rel1) // should be 'test'
}, 1000)

setTimeout(() => {
  const rel2 = jwtResolve(jwt, 'wrong key');
  console.log('2: ' + rel2) // wrong key, should be null
}, 1500)

setTimeout(() => {
  const rel3 = jwtResolve(jwt, cert);
  console.log('3: ' + rel3) // expired, should be null
}, 3000)

```

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