summaryrefslogtreecommitdiff
path: root/cli/js/40_jupyter.js
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-09-27 02:21:06 +0200
committerGitHub <noreply@github.com>2023-09-27 02:21:06 +0200
commit46a4bd5178f5aed22041422c431b5ab6f697865d (patch)
treebb72699b0c18ace70b7dd8c7434a211703edba14 /cli/js/40_jupyter.js
parentd39659332c224dfee51a43499c2d2d5da12a0da8 (diff)
feat(unstable): add `Deno.jupyter.broadcast` API (#20656)
Closes https://github.com/denoland/deno/issues/20591 --------- Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
Diffstat (limited to 'cli/js/40_jupyter.js')
-rw-r--r--cli/js/40_jupyter.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/cli/js/40_jupyter.js b/cli/js/40_jupyter.js
new file mode 100644
index 000000000..8cdf0789a
--- /dev/null
+++ b/cli/js/40_jupyter.js
@@ -0,0 +1,16 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+const core = globalThis.Deno.core;
+const internals = globalThis.__bootstrap.internals;
+
+import { denoNsUnstable } from "ext:runtime/90_deno_ns.js";
+
+function enableJupyter() {
+ denoNsUnstable.jupyter = {
+ async broadcast(msgType, content) {
+ await core.opAsync("op_jupyter_broadcast", msgType, content);
+ },
+ };
+}
+
+internals.enableJupyter = enableJupyter;