1
1
'use strict' ;
2
2
3
- exports = module . exports = {
4
- makeRequireFunction,
5
- stripBOM,
6
- stripShebang,
7
- addBuiltinLibsToObject
8
- } ;
9
-
10
- exports . requireDepth = 0 ;
11
-
12
3
// Invoke with makeRequireFunction(module) where |module| is the Module object
13
4
// to use as the context for the require() function.
14
5
function makeRequireFunction ( mod ) {
@@ -85,7 +76,7 @@ function stripShebang(content) {
85
76
return content ;
86
77
}
87
78
88
- exports . builtinLibs = [
79
+ const builtinLibs = [
89
80
'assert' , 'buffer' , 'child_process' , 'cluster' , 'crypto' , 'dgram' , 'dns' ,
90
81
'domain' , 'events' , 'fs' , 'http' , 'https' , 'net' , 'os' , 'path' , 'punycode' ,
91
82
'querystring' , 'readline' , 'repl' , 'stream' , 'string_decoder' , 'tls' , 'tty' ,
@@ -94,7 +85,7 @@ exports.builtinLibs = [
94
85
95
86
function addBuiltinLibsToObject ( object ) {
96
87
// Make built-in modules available directly (loaded lazily).
97
- exports . builtinLibs . forEach ( ( name ) => {
88
+ builtinLibs . forEach ( ( name ) => {
98
89
// Goals of this mechanism are:
99
90
// - Lazy loading of built-in modules
100
91
// - Having all built-in modules available as non-enumerable properties
@@ -130,3 +121,12 @@ function addBuiltinLibsToObject(object) {
130
121
} ) ;
131
122
} ) ;
132
123
}
124
+
125
+ module . exports = exports = {
126
+ addBuiltinLibsToObject,
127
+ builtinLibs,
128
+ makeRequireFunction,
129
+ requireDepth : 0 ,
130
+ stripBOM,
131
+ stripShebang
132
+ } ;
0 commit comments