Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastify/cookie

Package Overview
Dependencies
Maintainers
18
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/cookie - npm Package Compare versions

Comparing version 6.0.0 to 7.0.0

6

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc