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

express-once

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-once

Create express middleware that just runs once.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
16
-56.76%
Maintainers
1
Weekly downloads
 
Created
Source

express-once

Create express middleware that just runs once.

build status coverage license version downloads

Ever wish you could make a function that would only ever be called once per request? Well now you can with once! Simple wrap your function in once and add as many times as you like to your app with the satisfcation that it will only ever be invoked... once.

var express = require('express'),
	once = require('express-once');

var app = express();

// Ensure this function is only called once
var hello = once(function middleware(req, res, next) {
	console.log('Hello world.');
});

// Try to call it many times... but it won't!
app.use(hello, hello, hello);

Keywords

express

FAQs

Package last updated on 09 Jan 2015

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