Catalog npm
PACKAGE EXPLORERView in registry

2ex

npm

An opinionated express application framework

expressframeworkmicroservicesservice oriented architecture
Versions collected4
Direct dependencies8From release 1.0.0-3
Last observed20 Oct, 19:12 UTC

README

Current package documentation

2ex (pronounced 2X)

NPM Version NPM Downloads Build Status js-standard-style

A semi-opinionated framework for setting up Express apps.

Install

$ npm install --save 2ex

Usage

const createApp = require('2ex')

const runApp = createApp((app, opts = {}) => {
  // Handle app errors
  app.on('error', console.error)

  // Load in your routes
  app.get('/', (req, res) => {
    res.send(`Hello ${opts.message}!`)
  })
})

// Start the app
runApp({
  port: 8080,
  message: 'World'
}).then(({ app, server }) => {
  const addr = server.address()
  console.log(`Server started at http://${app.get('host')}:${addr.port}`)
})

What does it do?

This package sets up common requirements for running an Express app in production with the goal of reducing boilerplate in your applications. Here is a list of some of those things:

  • Uses next gen Express (5.0.0-alpha.7 at the time of publishing this)
  • Express app settings
    • Remove x-powered-by header
    • Sets query string parsing to simple (faster, more secure, planned default for 5.0)
  • Set process title (nice for identifying your server process)
  • Catch, report and exit on uncaughtException and unhandledRejection
  • Handle and report server clientErrors
  • Parses JSON bodies
  • Parses cookies (off by default, turn on by passing options.parseCookies

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 4

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0-3Registry latest6 Dec 20188
1.0.0-25 Dec 20188
1.0.0-15 Dec 20188
1.0.0-030 Jan 201811

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
wesleytodd/2ex

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:12 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0255348baaca7569dbbedb27853f8138743b713a7304b99e3b9b2b0705ea72b5