@fastify/cookie
Advanced tools
Comparing version 6.0.0 to 7.0.0
{ | ||
"name": "@fastify/cookie", | ||
"version": "6.0.0", | ||
"version": "7.0.0", | ||
"description": "Plugin for fastify to add support for cookies", | ||
@@ -43,5 +43,5 @@ "main": "plugin.js", | ||
"@types/node": "^17.0.16", | ||
"fastify": "^3.27.1", | ||
"fastify": "^4.0.0-rc.2", | ||
"pre-commit": "^1.2.2", | ||
"sinon": "^13.0.1", | ||
"sinon": "^14.0.0", | ||
"snazzy": "^9.0.0", | ||
@@ -48,0 +48,0 @@ "standard": "^17.0.0", |
@@ -94,4 +94,4 @@ 'use strict' | ||
const fastifyCookie = fp(plugin, { | ||
fastify: '>=3', | ||
name: 'fastify-cookie' | ||
fastify: '4.x', | ||
name: '@fastify/cookie' | ||
}) | ||
@@ -98,0 +98,0 @@ |
@@ -1,5 +0,5 @@ | ||
# fastify-cookie | ||
# @fastify/cookie | ||
![CI](https://github.com/fastify/fastify-cookie/workflows/CI/badge.svg) | ||
[![NPM version](https://img.shields.io/npm/v/fastify-cookie.svg?style=flat)](https://www.npmjs.com/package/fastify-cookie) | ||
[![NPM version](https://img.shields.io/npm/v/@fastify/cookie.svg?style=flat)](https://www.npmjs.com/package/@fastify/cookie) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/fastify/fastify-cookie/badge.svg)](https://snyk.io/test/github/fastify/fastify-cookie) | ||
@@ -15,6 +15,17 @@ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) | ||
`fastify-cookie` [v2.x](https://github.com/fastify/fastify-cookie/tree/v2.x) | ||
`@fastify/cookie` [v2.x](https://github.com/fastify/fastify-cookie/tree/v2.x) | ||
supports both Fastify@1 and Fastify@2. | ||
`fastify-cookie` v3 only supports Fastify@2. | ||
`@fastify/cookie` v3 only supports Fastify@2. | ||
## Installation | ||
```sh | ||
npm i @fastify/cookie | ||
``` | ||
or | ||
```sh | ||
yarn add @fastify/cookie | ||
``` | ||
## Example | ||
@@ -25,3 +36,3 @@ | ||
fastify.register(require('fastify-cookie'), { | ||
fastify.register(require('@fastify/cookie'), { | ||
secret: "my-secret", // for cookies signature | ||
@@ -52,4 +63,4 @@ parseOptions: {} // options for parsing cookies | ||
```ts | ||
import { FastifyCookieOptions } from 'fastify-cookie' | ||
import cookie from 'fastify-cookie' | ||
import { FastifyCookieOptions } from '@fastify/cookie' | ||
import cookie from '@fastify/cookie' | ||
import fastify from 'fastify' | ||
@@ -132,3 +143,3 @@ | ||
```js | ||
fastify.register(require('fastify-cookie'), { | ||
fastify.register(require('@fastify/cookie'), { | ||
secret: [key1, key2] | ||
@@ -168,3 +179,3 @@ }) | ||
```js | ||
fastify.register(require('fastify-cookie'), { | ||
fastify.register(require('@fastify/cookie'), { | ||
secret: { | ||
@@ -196,3 +207,3 @@ sign: (value) => { | ||
```js | ||
fastify.register(require('fastify-cookie'), { secret: 'my-secret' }) | ||
fastify.register(require('@fastify/cookie'), { secret: 'my-secret' }) | ||
@@ -199,0 +210,0 @@ fastify.get('/', (req, rep) => { |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
55986
218
1