summaryrefslogtreecommitdiff
path: root/cli/js/40_jupyter.js
blob: 5a30a6b8e85375b3f5f92b33ef743655fd8ced02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

const core = globalThis.Deno.core;
const internals = globalThis.__bootstrap.internals;

function enableJupyter() {
  const {
    op_jupyter_broadcast,
  } = core.ensureFastOps();

  globalThis.Deno.jupyter = {
    async broadcast(msgType, content, { metadata = {}, buffers = [] } = {}) {
      await op_jupyter_broadcast(msgType, content, metadata, buffers);
    },
  };
}

internals.enableJupyter = enableJupyter;