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

express-exorcism

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-exorcism

Express.js router wrapper for async routes

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Express Exorcism

Build Status Coverage Status NPM Downloads

dependencies Status devDependencies Status Codacy Badge

express-exorcism is an Express.js Router wrapper that helps to handle async routes.

NB: Minimal Node version is 7.5.0 with --harmony or 7.6.0.

Installation

npm install express-exorcism --save

or

yarn add express-exorcism

Usage

Run espress-exorcism once before first router usage to wrap entire express. e.g. right after fist express require:

var express = require('express');
require('express-exorcism')(express);
var router = express.Router();
...

or es6

import express from 'express'
import exorcism from 'express-exorcism'
exorcism(express)
const router = express.Router();
...

NB: If you're using import instead of require and express-exorcism is not working for you, it means that express.Router instances are created before express-exorcism wrapper is run. For example if you have import './routes' even after wrapping express - node will run it before.

Singleton wrapper

By default you can wrap express only once with one configuration.

If you need different configurations for different routers or other strange stuff - consider to use singletonRouter option to create router instance wrappers:

var express = require('express');
var router = require('express-exorcism')(express, {singletonRouter: true});
...

or es6

import express from 'express'
import exorcism from 'express-exorcism'

const router = exorcism(express, {singletonRouter: true})
...

NB: router will represent wrapped express.Router() instance, instead of modifying original express.Router methods.

Problems?

Please file an issue on github!

Keywords

FAQs

Package last updated on 08 Oct 2018

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