Socket
Book a DemoInstallSign in
Socket

express6

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express6

🏅 Modern, fast, unopinionated, minimalist web framework.

0.1.2
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

express6 logo

Modern, fast, unopinionated, minimalist web framework for node.

Github Workflow Github Workflow Snyk Vulnerabilities for GitHub Repo Node version Codecov Sponsors CodeStyle Prettier

// npm install express6

import { express } from 'express'
const app = express()

app.get('/', (req, res) => {
  res.send('Hello World')
})

app.listen(3000)

What?

Why?

I love express and would love to see people using it for at least another 10 years!

What about "Unhandled Promise Rejection"?

This has been take care of 👍

ESModules?

It is ready to be exported as esm, but express6 v1 is all about compatibility with express v4, therefore express6 is ships as commonjs.

New

I added req.URL, a short-hand getter for new URL(this.req, `http://${req.headers.host}`).

Types

The types are simpler and a bit different than in express v4. For example, all 3 app.use() below are valid, but express6 throws a type error on the third app.use(). In the example below, I recommend using the spread operator.

Middleware with TypeScript

// some middleware
const midi = (req, res, next) => next()

app.get('/', ...[midi, midi], (req, res) => {})
app.get('/', midi, midi, (req, res) => {})
// @ts-ignore
app.get('/', [midi, midi], (req, res) => {})

Error routes with TypeScript

import type { Request, Response, NextFunction } from 'express6'

// @ts-ignore
app.use((err: any, req: Request, res: Response, next: NextFunction) => {
  console.log('ERROR:', err)
  return res.send(err)
})

Todo

  • improve types
  • remove all @ts-ignore
  • stricten tsconfig

Make a PR!

Breaking Changes?

Yes, same as Express v5.

Everything Else?

Same as expressjs.

Keywords

express

FAQs

Package last updated on 18 Nov 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.