@tsndr/cloudflare-worker-jwt
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "@tsndr/cloudflare-worker-jwt", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "A lightweight JWT implementation with ZERO dependencies for Cloudflare Worker", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"lint": "tslint index.js" | ||
}, | ||
@@ -25,3 +25,6 @@ "repository": { | ||
}, | ||
"homepage": "https://github.com/tsndr/cloudflare-worker-jwt#readme" | ||
"homepage": "https://github.com/tsndr/cloudflare-worker-jwt#readme", | ||
"devDependencies": { | ||
"tslint": "^6.1.3" | ||
} | ||
} |
@@ -7,5 +7,11 @@ # Cloudflare Worker JWT | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Install](#install) | ||
## Install | ||
``` | ||
npm i @tsndr/cloudflare-worker-jwt | ||
``` | ||
## Usage | ||
@@ -29,2 +35,4 @@ | ||
<hr> | ||
### `jwt.sign(payload, secret, [algorithm])` | ||
@@ -34,18 +42,15 @@ | ||
#### Arguments | ||
`payload` | ||
Argument | Type | Satus | Default | Description | ||
----------- | -------- | -------- | ------- | ----------- | ||
`payload` | `object` | required | - | The payload object | ||
`secret` | `string` | required | - | A string which is used to sign the payload. | ||
`algorithm` | `string` | optional | `HS256` | The algorithm used to sign the payload, possible values: `HS256` or `HS512` | ||
The payload object. | ||
#### `return` | ||
returns token as a `string` | ||
<hr> | ||
`secret` | ||
A string which is used to sign the payload. | ||
`algorithm` (optional, default: `HS256`) | ||
The algorithm used to sign the payload, possible values: `HS256` or `HS512` | ||
### `jwt.verify(token, secret, [algorithm])` | ||
@@ -55,17 +60,13 @@ | ||
Argument | Type | Satus | Default | Description | ||
----------- | -------- | -------- | ------- | ----------- | ||
`token` | `string` | required | - | The token string generated by `jwt.sign()`. | ||
`secret` | `string` | required | - | The string which was used to sign the payload. | ||
`algorithm` | `string` | optional | `HS256` | The algorithm used to sign the payload, possible values: `HS256` or `HS512` | ||
`token` | ||
#### `return` | ||
returns `boolean` | ||
The token string generated by `jwt.sign()`. | ||
<hr> | ||
`secret` | ||
A string which is used to sign the payload. | ||
`algorithm` (optional, default: `HS256`) | ||
The algorithm used to sign the payload, possible values: `HS256` or `HS512` | ||
### `jwt.decode(token)` | ||
@@ -75,12 +76,7 @@ | ||
Argument | Type | Satus | Default | Description | ||
----------- | -------- | -------- | ------- | ----------- | ||
`token` | `string` | required | - | The token string generated by `jwt.sign()`. | ||
`token` | ||
The token string generated by `jwt.sign()`. | ||
## Install | ||
``` | ||
npm i @tsndr/cloudflare-worker-jwt | ||
``` | ||
#### `return` | ||
returns payload `object` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
11544
8
156
0
1
77