# jwt-core

> use simple jwt

Latest version **1.1.0** (published 2020-02-01) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2020-02-01 |
| First published | 2020-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | Park Si-Yual |
| Maintainers | araxsiyual |
| Keywords | node, jwt, token |

## Links

- npm: https://www.npmjs.com/package/jwt-core
- Homepage: https://github.com/kdPark0723/jwt-core
- Issues: https://github.com/kdPark0723/jwt-core/issues
- npm.io page: https://npm.io/package/jwt-core

## Dependencies (1)

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

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-02-01
- 1.0.4 — 2020-01-14
- 1.0.3 — 2020-01-12
- 1.0.2 — 2020-01-12
- 1.0.1 — 2020-01-12
- 1.0.0 — 2020-01-12
- 0.0.0 — 2020-01-12

## README

# JWT Core

**You can simply use jwt**

​    

This project was created to make using `jsonwebtoken` easier.

Most features can be used the same as `jsonwebtoken`

​    

## Install

```shell
$ npm i jwt-core
```

​    

## Usage

### Create Token By Payload

```js
const jwt = require('jwt-core')

const token = new jwt.Token(payload);
```

- `payload` is same [`jsonwebtoken`](https://www.npmjs.com/package/jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback)

​    

#### you also use create method

```js
const jwt = require('jwt-core')

const token = jwt.Token.createByPayload(payload);
```

- `payload` is same [`jsonwebtoken`](https://www.npmjs.com/package/jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback)

​    

### Create Token By Aliased Payload

```js
const jwt = require('jwt-core')

const token = jwt.Token.createByAliasPayload(payload);
```

- you can use claim key by aliased key

  ```js
  {
    issuer: 'iss',
    subject: 'sub',
    audience: 'aud',
    expiresIn: 'exp',
    notBefore: 'nbf',
    issuedAt: 'iat',
    jwtId: 'jti',
  }
  ```

- `payload` is same [`jsonwebtoken`](https://www.npmjs.com/package/jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback)

​    

### Create Token By Encoding Token

```js
const jwt = require('jwt-core')

const token = jwt.Token.createByEncodingToken(jwtString, secretOrPrivateKey, options);
```

- `options` is same [`jsonwebtoken`](https://www.npmjs.com/package/jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback)

​    

### Encode Token

```js
token.encode(secretOrPrivateKey, options);
```

- `options` is same [`jsonwebtoken`](https://www.npmjs.com/package/jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback)

​    

### Get And Set Token Claim

#### Get

```js
token.get(key);
```

- Alias is applied

​    

#### Set

```js
token.set(key, value);
```

- Alias is applied

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