New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

caddy

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

caddy

caddy =====

latest
Source
npmnpm
Version
0.0.13
Version published
Maintainers
1
Created
Source

caddy

Per-request storage for arbitrary data.

When the Caddy middleware is called (ex by Express), Caddy creates a data store that is accessable from any sub-modules used while handling the request. This can be a lot cleaner than attaching data to the res/req objects, which then have to be repeatedly passed around as parameters.

Each request has it's own instance of the Caddy data store. There is no chance for the Caddy data of seperate requests to interact with each other, and no need for the user to keep track of which data belongs to which request.

The data store is maintained across events and other async functions such as process.nextTick(). By extension, the store will still be available after higher-level async functions like http.request().

Install

$ npm install caddy

Middleware

var Caddy = require('caddy');
var express = require('express');
var app = express();

app.use(Caddy.connect);

API

Once the Caddy middleware has been called, you can get() and set() data from anywhere in your code.

var Caddy = require('caddy');

Caddy.set('key', 'data');
expect(Caddy.get('key')).to.equal('key');

FAQs

Package last updated on 28 Nov 2013

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