fix(refactor): prefix built-in node module imports

Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
This commit is contained in:
Szymon Łągiewka 2024-12-21 22:58:33 +01:00 committed by Wes Todd
parent 6a40af8293
commit 41113599af
52 changed files with 442 additions and 441 deletions

View File

@ -7,6 +7,7 @@ unreleased
* cleanup: remove unnecessary require for global Buffer
* perf: use loop for acceptParams
* Replace `methods` dependency with standard library
* refactor: prefix built-in node module imports
5.0.1 / 2024-10-08
==========

View File

@ -6,7 +6,7 @@
var express = require('../..');
var hash = require('pbkdf2-password')()
var path = require('path');
var path = require('node:path');
var session = require('express-session');
var app = module.exports = express();

View File

@ -5,7 +5,7 @@
*/
var express = require('../../');
var path = require('path');
var path = require('node:path');
var app = module.exports = express();

View File

@ -5,7 +5,7 @@
*/
var express = require('../../');
var path = require('path');
var path = require('node:path');
var app = module.exports = express();

View File

@ -5,7 +5,7 @@
*/
var express = require('../../');
var path = require('path');
var path = require('node:path');
var app = module.exports = express();
var logger = require('morgan');
var silent = process.env.NODE_ENV === 'test'

View File

@ -6,9 +6,9 @@
var escapeHtml = require('escape-html');
var express = require('../..');
var fs = require('fs');
var fs = require('node:fs');
var marked = require('marked');
var path = require('path');
var path = require('node:path');
var app = module.exports = express();

View File

@ -6,7 +6,7 @@
var express = require('../..');
var logger = require('morgan');
var path = require('path');
var path = require('node:path');
var session = require('express-session');
var methodOverride = require('method-override');

View File

@ -5,8 +5,8 @@
*/
var express = require('../../..');
var fs = require('fs');
var path = require('path');
var fs = require('node:fs');
var path = require('node:path');
module.exports = function(parent, options){
var dir = path.join(__dirname, '..', 'controllers');

View File

@ -5,7 +5,7 @@
*/
var express = require('../..');
var path = require('path');
var path = require('node:path');
var app = express();
var logger = require('morgan');
var cookieParser = require('cookie-parser');

View File

@ -12,7 +12,7 @@
*/
var express = require('../..');
var path = require('path');
var path = require('node:path');
var redis = require('redis');
var db = redis.createClient();

View File

@ -6,7 +6,7 @@
var express = require('../..');
var logger = require('morgan');
var path = require('path');
var path = require('node:path');
var app = express();
// log requests

View File

@ -4,8 +4,8 @@
* Module dependencies.
*/
var https = require('https');
var path = require('path');
var https = require('node:https');
var path = require('node:path');
var extname = path.extname;
/**

View File

@ -5,7 +5,7 @@
*/
var express = require('../..');
var path = require('path');
var path = require('node:path');
var User = require('./user');
var app = express();

View File

@ -16,12 +16,12 @@
var finalhandler = require('finalhandler');
var debug = require('debug')('express:application');
var View = require('./view');
var http = require('http');
var http = require('node:http');
var methods = require('./utils').methods;
var compileETag = require('./utils').compileETag;
var compileQueryParser = require('./utils').compileQueryParser;
var compileTrust = require('./utils').compileTrust;
var resolve = require('path').resolve;
var resolve = require('node:path').resolve;
var once = require('once')
var Router = require('router');
@ -468,8 +468,8 @@ app.disable = function disable(setting) {
* Delegate `.VERB(...)` calls to `router.VERB(...)`.
*/
methods.forEach(function(method){
app[method] = function(path){
methods.forEach(function (method) {
app[method] = function (path) {
if (method === 'get' && arguments.length === 1) {
// app.get(setting)
return this.set(path);
@ -583,8 +583,8 @@ app.render = function render(name, options, callback) {
* and HTTPS server you may do so with the "http"
* and "https" modules as shown here:
*
* var http = require('http')
* , https = require('https')
* var http = require('node:http')
* , https = require('node:https')
* , express = require('express')
* , app = express();
*
@ -595,7 +595,7 @@ app.render = function render(name, options, callback) {
* @public
*/
app.listen = function listen () {
app.listen = function listen() {
var server = http.createServer(this)
var args = Array.prototype.slice.call(arguments)
if (typeof args[args.length - 1] === 'function') {

View File

@ -13,7 +13,7 @@
*/
var bodyParser = require('body-parser')
var EventEmitter = require('events').EventEmitter;
var EventEmitter = require('node:events').EventEmitter;
var mixin = require('merge-descriptors');
var proto = require('./application');
var Router = require('router');

View File

@ -14,9 +14,9 @@
*/
var accepts = require('accepts');
var isIP = require('net').isIP;
var isIP = require('node:net').isIP;
var typeis = require('type-is');
var http = require('http');
var http = require('node:http');
var fresh = require('fresh');
var parseRange = require('range-parser');
var parse = require('parseurl');

View File

@ -16,11 +16,11 @@ var contentDisposition = require('content-disposition');
var createError = require('http-errors')
var encodeUrl = require('encodeurl');
var escapeHtml = require('escape-html');
var http = require('http');
var http = require('node:http');
var onFinished = require('on-finished');
var mime = require('mime-types')
var path = require('path');
var pathIsAbsolute = require('path').isAbsolute;
var path = require('node:path');
var pathIsAbsolute = require('node:path').isAbsolute;
var statuses = require('statuses')
var sign = require('cookie-signature').sign;
var normalizeType = require('./utils').normalizeType;

View File

@ -14,8 +14,8 @@
*/
var debug = require('debug')('express:view');
var path = require('path');
var fs = require('fs');
var path = require('node:path');
var fs = require('node:fs');
/**
* Module variables.

View File

@ -1,7 +1,7 @@
'use strict'
var after = require('after');
var assert = require('assert')
var assert = require('node:assert')
var express = require('../')
, Route = express.Route
, methods = require('../lib/utils').methods

View File

@ -4,10 +4,10 @@ var after = require('after');
var express = require('../')
, Router = express.Router
, methods = require('../lib/utils').methods
, assert = require('assert');
, assert = require('node:assert');
describe('Router', function(){
it('should return a function with router methods', function() {
describe('Router', function () {
it('should return a function with router methods', function () {
var router = new Router();
assert(typeof router === 'function')
@ -16,32 +16,32 @@ describe('Router', function(){
assert(typeof router.use === 'function')
});
it('should support .use of other routers', function(done){
it('should support .use of other routers', function (done) {
var router = new Router();
var another = new Router();
another.get('/bar', function(req, res){
another.get('/bar', function (req, res) {
res.end();
});
router.use('/foo', another);
router.handle({ url: '/foo/bar', method: 'GET' }, { end: done }, function(){});
router.handle({ url: '/foo/bar', method: 'GET' }, { end: done }, function () { });
});
it('should support dynamic routes', function(done){
it('should support dynamic routes', function (done) {
var router = new Router();
var another = new Router();
another.get('/:bar', function(req, res){
another.get('/:bar', function (req, res) {
assert.strictEqual(req.params.bar, 'route')
res.end();
});
router.use('/:foo', another);
router.handle({ url: '/test/route', method: 'GET' }, { end: done }, function(){});
router.handle({ url: '/test/route', method: 'GET' }, { end: done }, function () { });
});
it('should handle blank URL', function(done){
it('should handle blank URL', function (done) {
var router = new Router();
router.use(function (req, res) {
@ -88,10 +88,10 @@ describe('Router', function(){
})
})
it('should not stack overflow with many registered routes', function(done){
it('should not stack overflow with many registered routes', function (done) {
this.timeout(5000) // long-running test
var handler = function(req, res){ res.end(new Error('wrong handler')) };
var handler = function (req, res) { res.end(new Error('wrong handler')) };
var router = new Router();
for (var i = 0; i < 6000; i++) {
@ -102,7 +102,7 @@ describe('Router', function(){
res.end();
});
router.handle({ url: '/', method: 'GET' }, { end: done }, function(){});
router.handle({ url: '/', method: 'GET' }, { end: done }, function () { });
});
it('should not stack overflow with a large sync route stack', function (done) {
@ -159,69 +159,69 @@ describe('Router', function(){
})
})
describe('.handle', function(){
it('should dispatch', function(done){
describe('.handle', function () {
it('should dispatch', function (done) {
var router = new Router();
router.route('/foo').get(function(req, res){
router.route('/foo').get(function (req, res) {
res.send('foo');
});
var res = {
send: function(val) {
send: function (val) {
assert.strictEqual(val, 'foo')
done();
}
}
router.handle({ url: '/foo', method: 'GET' }, res, function(){});
router.handle({ url: '/foo', method: 'GET' }, res, function () { });
})
})
describe('.multiple callbacks', function(){
it('should throw if a callback is null', function(){
describe('.multiple callbacks', function () {
it('should throw if a callback is null', function () {
assert.throws(function () {
var router = new Router();
router.route('/foo').all(null);
})
})
it('should throw if a callback is undefined', function(){
it('should throw if a callback is undefined', function () {
assert.throws(function () {
var router = new Router();
router.route('/foo').all(undefined);
})
})
it('should throw if a callback is not a function', function(){
it('should throw if a callback is not a function', function () {
assert.throws(function () {
var router = new Router();
router.route('/foo').all('not a function');
})
})
it('should not throw if all callbacks are functions', function(){
it('should not throw if all callbacks are functions', function () {
var router = new Router();
router.route('/foo').all(function(){}).all(function(){});
router.route('/foo').all(function () { }).all(function () { });
})
})
describe('error', function(){
it('should skip non error middleware', function(done){
describe('error', function () {
it('should skip non error middleware', function (done) {
var router = new Router();
router.get('/foo', function(req, res, next){
router.get('/foo', function (req, res, next) {
next(new Error('foo'));
});
router.get('/bar', function(req, res, next){
router.get('/bar', function (req, res, next) {
next(new Error('bar'));
});
router.use(function(req, res, next){
router.use(function (req, res, next) {
assert(false);
});
router.use(function(err, req, res, next){
router.use(function (err, req, res, next) {
assert.equal(err.message, 'foo');
done();
});
@ -229,59 +229,59 @@ describe('Router', function(){
router.handle({ url: '/foo', method: 'GET' }, {}, done);
});
it('should handle throwing inside routes with params', function(done) {
it('should handle throwing inside routes with params', function (done) {
var router = new Router();
router.get('/foo/:id', function () {
throw new Error('foo');
});
router.use(function(req, res, next){
router.use(function (req, res, next) {
assert(false);
});
router.use(function(err, req, res, next){
router.use(function (err, req, res, next) {
assert.equal(err.message, 'foo');
done();
});
router.handle({ url: '/foo/2', method: 'GET' }, {}, function() {});
router.handle({ url: '/foo/2', method: 'GET' }, {}, function () { });
});
it('should handle throwing in handler after async param', function(done) {
it('should handle throwing in handler after async param', function (done) {
var router = new Router();
router.param('user', function(req, res, next, val){
process.nextTick(function(){
router.param('user', function (req, res, next, val) {
process.nextTick(function () {
req.user = val;
next();
});
});
router.use('/:user', function(req, res, next){
router.use('/:user', function (req, res, next) {
throw new Error('oh no!');
});
router.use(function(err, req, res, next){
router.use(function (err, req, res, next) {
assert.equal(err.message, 'oh no!');
done();
});
router.handle({ url: '/bob', method: 'GET' }, {}, function() {});
router.handle({ url: '/bob', method: 'GET' }, {}, function () { });
});
it('should handle throwing inside error handlers', function(done) {
it('should handle throwing inside error handlers', function (done) {
var router = new Router();
router.use(function(req, res, next){
router.use(function (req, res, next) {
throw new Error('boom!');
});
router.use(function(err, req, res, next){
router.use(function (err, req, res, next) {
throw new Error('oops');
});
router.use(function(err, req, res, next){
router.use(function (err, req, res, next) {
assert.equal(err.message, 'oops');
done();
});
@ -412,17 +412,17 @@ describe('Router', function(){
});
})
describe('.all', function() {
it('should support using .all to capture all http verbs', function(done){
describe('.all', function () {
it('should support using .all to capture all http verbs', function (done) {
var router = new Router();
var count = 0;
router.all('/foo', function(){ count++; });
router.all('/foo', function () { count++; });
var url = '/foo?bar=baz';
methods.forEach(function testMethod(method) {
router.handle({ url: url, method: method }, {}, function() {});
router.handle({ url: url, method: method }, {}, function () { });
});
assert.equal(count, methods.length);
@ -430,7 +430,7 @@ describe('Router', function(){
})
})
describe('.use', function() {
describe('.use', function () {
it('should require middleware', function () {
var router = new Router()
assert.throws(function () { router.use('/') }, /argument handler is required/)
@ -460,7 +460,7 @@ describe('Router', function(){
var cb = after(4, done)
var router = new Router()
function no () {
function no() {
throw new Error('should not be called')
}
@ -474,30 +474,30 @@ describe('Router', function(){
router.handle({ url: '*', method: 'GET' }, { end: cb }, no)
})
it('should accept array of middleware', function(done){
it('should accept array of middleware', function (done) {
var count = 0;
var router = new Router();
function fn1(req, res, next){
function fn1(req, res, next) {
assert.equal(++count, 1);
next();
}
function fn2(req, res, next){
function fn2(req, res, next) {
assert.equal(++count, 2);
next();
}
router.use([fn1, fn2], function(req, res){
router.use([fn1, fn2], function (req, res) {
assert.equal(++count, 3);
done();
});
router.handle({ url: '/foo', method: 'GET' }, {}, function(){});
router.handle({ url: '/foo', method: 'GET' }, {}, function () { });
})
})
describe('.param', function() {
describe('.param', function () {
it('should require function', function () {
var router = new Router();
assert.throws(router.param.bind(router, 'id'), /argument fn is required/);
@ -508,15 +508,15 @@ describe('Router', function(){
assert.throws(router.param.bind(router, 'id', 42), /argument fn must be a function/);
});
it('should call param function when routing VERBS', function(done) {
it('should call param function when routing VERBS', function (done) {
var router = new Router();
router.param('id', function(req, res, next, id) {
router.param('id', function (req, res, next, id) {
assert.equal(id, '123');
next();
});
router.get('/foo/:id/bar', function(req, res, next) {
router.get('/foo/:id/bar', function (req, res, next) {
assert.equal(req.params.id, '123');
next();
});
@ -524,15 +524,15 @@ describe('Router', function(){
router.handle({ url: '/foo/123/bar', method: 'get' }, {}, done);
});
it('should call param function when routing middleware', function(done) {
it('should call param function when routing middleware', function (done) {
var router = new Router();
router.param('id', function(req, res, next, id) {
router.param('id', function (req, res, next, id) {
assert.equal(id, '123');
next();
});
router.use('/foo/:id/bar', function(req, res, next) {
router.use('/foo/:id/bar', function (req, res, next) {
assert.equal(req.params.id, '123');
assert.equal(req.url, '/baz');
next();
@ -541,17 +541,17 @@ describe('Router', function(){
router.handle({ url: '/foo/123/bar/baz', method: 'get' }, {}, done);
});
it('should only call once per request', function(done) {
it('should only call once per request', function (done) {
var count = 0;
var req = { url: '/foo/bob/bar', method: 'get' };
var router = new Router();
var sub = new Router();
sub.get('/bar', function(req, res, next) {
sub.get('/bar', function (req, res, next) {
next();
});
router.param('user', function(req, res, next, user) {
router.param('user', function (req, res, next, user) {
count++;
req.user = user;
next();
@ -560,7 +560,7 @@ describe('Router', function(){
router.use('/foo/:user/', new Router());
router.use('/foo/:user/', sub);
router.handle(req, {}, function(err) {
router.handle(req, {}, function (err) {
if (err) return done(err);
assert.equal(count, 1);
assert.equal(req.user, 'bob');
@ -568,17 +568,17 @@ describe('Router', function(){
});
});
it('should call when values differ', function(done) {
it('should call when values differ', function (done) {
var count = 0;
var req = { url: '/foo/bob/bar', method: 'get' };
var router = new Router();
var sub = new Router();
sub.get('/bar', function(req, res, next) {
sub.get('/bar', function (req, res, next) {
next();
});
router.param('user', function(req, res, next, user) {
router.param('user', function (req, res, next, user) {
count++;
req.user = user;
next();
@ -587,7 +587,7 @@ describe('Router', function(){
router.use('/foo/:user/', new Router());
router.use('/:user/bob/', sub);
router.handle(req, {}, function(err) {
router.handle(req, {}, function (err) {
if (err) return done(err);
assert.equal(count, 2);
assert.equal(req.user, 'foo');
@ -596,8 +596,8 @@ describe('Router', function(){
});
});
describe('parallel requests', function() {
it('should not mix requests', function(done) {
describe('parallel requests', function () {
it('should not mix requests', function (done) {
var req1 = { url: '/foo/50/bar', method: 'get' };
var req2 = { url: '/foo/10/bar', method: 'get' };
var router = new Router();
@ -605,11 +605,11 @@ describe('Router', function(){
var cb = after(2, done)
sub.get('/bar', function(req, res, next) {
sub.get('/bar', function (req, res, next) {
next();
});
router.param('ms', function(req, res, next, ms) {
router.param('ms', function (req, res, next, ms) {
ms = parseInt(ms, 10);
req.ms = ms;
setTimeout(next, ms);
@ -618,14 +618,14 @@ describe('Router', function(){
router.use('/foo/:ms/', new Router());
router.use('/foo/:ms/', sub);
router.handle(req1, {}, function(err) {
router.handle(req1, {}, function (err) {
assert.ifError(err);
assert.equal(req1.ms, 50);
assert.equal(req1.originalUrl, '/foo/50/bar');
cb()
});
router.handle(req2, {}, function(err) {
router.handle(req2, {}, function (err) {
assert.ifError(err);
assert.equal(req2.ms, 10);
assert.equal(req2.originalUrl, '/foo/10/bar');

View File

@ -1,9 +1,9 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../')
, fs = require('fs');
var path = require('path')
, fs = require('node:fs');
var path = require('node:path')
function render(path, options, fn) {
fs.readFile(path, 'utf8', function(err, str){

View File

@ -2,7 +2,7 @@
var express = require('../');
var request = require('supertest');
var assert = require('assert');
var assert = require('node:assert');
describe('HEAD', function(){
it('should default to GET', function(done){

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('..')
var request = require('supertest')

View File

@ -1,7 +1,7 @@
'use strict'
var express = require('../')
var assert = require('assert')
var assert = require('node:assert')
describe('app.listen()', function(){
it('should wrap with an HTTP server', function(done){

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../')
describe('app', function(){

View File

@ -1,8 +1,8 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('..');
var path = require('path')
var path = require('node:path')
var tmpl = require('./support/tmpl');
describe('app', function(){

View File

@ -10,7 +10,7 @@ describe('app', function(){
var app = express();
app.request.querystring = function(){
return require('url').parse(this.url).query;
return require('node:url').parse(this.url).query;
};
app.use(function(req, res){

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../')
, request = require('supertest');

View File

@ -1,7 +1,7 @@
'use strict'
var after = require('after');
var assert = require('assert')
var assert = require('node:assert')
var express = require('..');
var request = require('supertest');

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert');
var assert = require('node:assert');
var express = require('..');
describe('config', function () {

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../');
var request = require('supertest');

View File

@ -1,7 +1,7 @@
'use strict'
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('..')
var request = require('supertest')

View File

@ -1,7 +1,7 @@
'use strict'
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('..')
var request = require('supertest')

View File

@ -1,8 +1,8 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('..')
var path = require('path')
var path = require('node:path')
var request = require('supertest')
var utils = require('./support/utils')

View File

@ -1,7 +1,7 @@
'use strict'
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('..')
var request = require('supertest')

View File

@ -1,7 +1,7 @@
'use strict'
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('..')
var request = require('supertest')

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../');
var request = require('supertest');

View File

@ -2,7 +2,7 @@
var express = require('../')
, request = require('supertest')
, assert = require('assert');
, assert = require('node:assert');
describe('req', function(){
describe('.get(field)', function(){

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('../')
, request = require('supertest');

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('..')
var request = require('supertest')

View File

@ -1,11 +1,11 @@
'use strict'
var after = require('after');
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('..');
var path = require('path')
var path = require('node:path')
var request = require('supertest');
var utils = require('./support/utils')

View File

@ -3,7 +3,7 @@
var after = require('after')
var express = require('../')
, request = require('supertest')
, assert = require('assert');
, assert = require('node:assert');
var app1 = express();

View File

@ -2,7 +2,7 @@
var express = require('../')
, request = require('supertest')
, assert = require('assert');
, assert = require('node:assert');
describe('res', function(){
describe('.json(object)', function(){

View File

@ -2,7 +2,7 @@
var express = require('../')
, request = require('supertest')
, assert = require('assert');
, assert = require('node:assert');
var utils = require('./support/utils');
describe('res', function(){

View File

@ -2,8 +2,8 @@
var express = require('../')
, request = require('supertest')
, assert = require('assert')
, url = require('url');
, assert = require('node:assert')
, url = require('node:url');
describe('res', function(){
describe('.location(url)', function(){

View File

@ -1,7 +1,7 @@
'use strict'
var express = require('..');
var path = require('path')
var path = require('node:path')
var request = require('supertest');
var tmpl = require('./support/tmpl');

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert')
var assert = require('node:assert')
var express = require('..');
var methods = require('../lib/utils').methods;
var request = require('supertest');

View File

@ -1,13 +1,13 @@
'use strict'
var after = require('after');
var assert = require('assert')
var AsyncLocalStorage = require('async_hooks').AsyncLocalStorage
var assert = require('node:assert')
var AsyncLocalStorage = require('node:async_hooks').AsyncLocalStorage
var express = require('../')
, request = require('supertest')
var onFinished = require('on-finished');
var path = require('path');
var path = require('node:path');
var fixtures = path.join(__dirname, 'fixtures');
var utils = require('./support/utils');

View File

@ -1,4 +1,4 @@
var fs = require('fs');
var fs = require('node:fs');
var variableRegExp = /\$([0-9a-zA-Z\.]+)/g;

View File

@ -4,7 +4,7 @@
* @private
*/
var assert = require('assert');
var assert = require('node:assert');
/**
* Module exports.

View File

@ -1,6 +1,6 @@
'use strict'
var assert = require('assert');
var assert = require('node:assert');
var utils = require('../lib/utils');
describe('utils.etag(body, encoding)', function(){