Skip to content

Commit e65e603

Browse files
isaacsry
authored andcommitted
Fix nodejs#169. Expose require members in the repl.
This fixes nodejs#169 by putting the require members onto the cwdRequire function which is exposed to the repl scope.
1 parent 431e72c commit e65e603

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/repl.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ function cwdRequire (id) {
2424
}
2525
return require(id);
2626
}
27+
Object.keys(require).forEach(function (k) {
28+
cwdRequire[k] = require[k];
29+
});
2730

2831
function setScope (self) {
2932
scope = {};

0 commit comments

Comments
 (0)