async-express
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "async-express", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Allow async/await syntax in Express routes and middleware", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -13,3 +13,3 @@ # async-express | ||
const express = require('express'); | ||
const _async = require('async-express'); | ||
const asyncExpress = require('async-express'); | ||
@@ -19,3 +19,3 @@ const app = express(); | ||
// As a route | ||
app.get('/', _async(async (req, res, next) => { | ||
app.get('/', asyncExpress(async (req, res, next) => { | ||
// Wait 5 seconds | ||
@@ -32,7 +32,7 @@ await new Promise(r => setTimeout(r, 5000)); | ||
const express = require('express'); | ||
const _async = require('async-express'); | ||
const asyncExpress = require('async-express'); | ||
const app = express(); | ||
const waitForABit = _async(async (req, res, next) => { | ||
const waitForABit = asyncExpress(async (req, res, next) => { | ||
// Wait 5 seconds | ||
@@ -39,0 +39,0 @@ await new Promise(r => setTimeout(r, 5000)); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1591