summaryrefslogtreecommitdiff
path: root/std/node/module.ts
diff options
context:
space:
mode:
authorChris Knight <cknight1234@gmail.com>2020-02-10 23:19:48 +0000
committerGitHub <noreply@github.com>2020-02-10 18:19:48 -0500
commit81905a867ea3f942619229e330840d132c57a5da (patch)
tree4bcdac6a58dfc5fd14e83f04c3f388a6d43968d3 /std/node/module.ts
parente1105a159406d8b64a833fa3266fd4ac7fc47a00 (diff)
feat: Event emitter node polyfill (#3944)
Diffstat (limited to 'std/node/module.ts')
-rw-r--r--std/node/module.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/std/node/module.ts b/std/node/module.ts
index f27ef25f2..ac436c555 100644
--- a/std/node/module.ts
+++ b/std/node/module.ts
@@ -26,6 +26,7 @@ import * as nodeUtil from "./util.ts";
import * as nodePath from "./path.ts";
import * as nodeTimers from "./timers.ts";
import * as nodeOs from "./os.ts";
+import * as nodeEvents from "./events.ts";
import * as path from "../path/mod.ts";
import { assert } from "../testing/asserts.ts";
@@ -579,11 +580,14 @@ function createNativeModule(id: string, exports: any): Module {
mod.loaded = true;
return mod;
}
+
nativeModulePolyfill.set("fs", createNativeModule("fs", nodeFS));
-nativeModulePolyfill.set("util", createNativeModule("util", nodeUtil));
+nativeModulePolyfill.set("events", createNativeModule("events", nodeEvents));
+nativeModulePolyfill.set("os", createNativeModule("os", nodeOs));
nativeModulePolyfill.set("path", createNativeModule("path", nodePath));
nativeModulePolyfill.set("timers", createNativeModule("timers", nodeTimers));
-nativeModulePolyfill.set("os", createNativeModule("os", nodeOs));
+nativeModulePolyfill.set("util", createNativeModule("util", nodeUtil));
+
function loadNativeModule(
_filename: string,
request: string