extra-express
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Support methods for express package.

Need to handle error from express routes using async?

const express = require('extra-express');
const http = require('http');


const app = express();
const server = http.createServer(app);
const sleep = (ms) => new Promise(fres => setTimeout(fres, ms));


app.get('/', express.async(async (req, res) => {
  await sleep(1000);
  res.send('Hello after 1s');
}));
server.listen(8000);

reference

const express = require('extra-express');
// : includes all functions of "express"


express.async(callback);
: callback(req, res, [next])

nodef

Package Sidebar

Install

npm i extra-express

Weekly Downloads

2

Version

1.0.2

License

BSD-3-Clause

Unpacked Size

3.62 kB

Total Files

6

Last publish

Collaborators

  • wolfram77