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

express-bakery

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-bakery

Make cookies using only query parameters. Convenient, simple, easy.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

express-bakery

Set cookies via query parameters.

  • Convenient -- no mucking around with cookie extensions, just write a url!
  • Simple -- no explaining to non-technical users how to install an extension and set a cookie, just send them a url like http://example.com?bake:in_experiment:true and once they visit it, they've got the cookie!

Installation

$ npm install --save express-bakery
# or
$ yarn add express-bakery

API

const express = require('express');
const app = express();

const bakery = require('express-bakery');
const opts = {
  queryParam: 'bake', // default
  whitelist: ['feature_flag1', 'feature_flag2'],
};

app.use(bakery(opts))
  .get('*', (req, res) => res.sendStatus(201))
  .listen(3000);

Usage

$ curl -v "http://localhost:3000/?bake=feature_flag1:true,feature_flag2:false,forbidden_feature_flag_3:true"
< HTTP/1.1 201 Created
< Set-Cookie: feature_flag1=true; Path=/
< Set-Cookie: feature_flag2=false; Path=/

Options

queryParam (string)

Default: bake

Name of the query parameter to be parsed for cookie names and values.

whitelist (array)

Default: []

Names of cookies that the bakery can make.

Keywords

FAQs

Package last updated on 02 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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