Skip to content

Commit

Permalink
1.0.5
Browse files Browse the repository at this point in the history
Changed description

Refine documentation

Changed TypeScript compile output location

Added installation instruction
  • Loading branch information
AlvinTheDeveloper committed Jun 20, 2023
1 parent dbcedcf commit da70e91
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 12 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
# cookie-signature-edge
#### An Edge Runtime package that sign and unsign cookies. This package is currently for Edge Runtime only.
#### A package that sign and unsign cookies for Edge API Routes.

## Installation
### With NPM
```bash
npm i cookie-signature-edge --save
```
### With Yarn
```bash
yarn add cookie-signature-edge --save
```

## Example
### Use this module in Edge API Routes
```js
import {sign,unsign} from 'cookie-signature-edge'
const value = "hello";
const secret='qwertyuiasdfghjkzxcvbnm';
const signedValue=await sign(value,secret);
const unsignedValue = await unsign(signedValue,secret)
// value===unsignedValue

export const config = {
runtime: 'edge',
}

export default async (req) => {
const value = "hello2";
const secret='qwertyuiasdfghjkzxcvbnm';
const signedValue=await sign(value,secret);
const unsignedValue = await unsign(signedValue,secret)
console.log(unsignedValue);
// value===unsignedValue
// unfinished code ...
}

```
## Contribution
#### Suggestions with code examples or pull requests are encouraged.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "cookie-signature-edge",
"version": "1.0.4",
"description": "An Edge Runtime package that sign and unsign cookies. This package is currently for Edge Runtime only.",
"version": "1.0.5",
"description": "A package that sign and unsign cookies for Edge API Routes.",
"keywords": ["edge","edge-runtime","nextjs","cookie", "sign", "unsign","signature"],
"main": "index.js",
"types": "index.d.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
{
"name": "next"
}
]
],
"outDir": "dist"
},
"include": [
"**/*.ts",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.tsbuildinfo

This file was deleted.

0 comments on commit da70e91

Please sign in to comment.