summaryrefslogtreecommitdiff
path: root/cli/js/40_jupyter.js
blob: 10dbccf4c5cc40935eb775346f3b4f5549457aa9 (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 = {} } = {}) {
      await op_jupyter_broadcast(msgType, content, metadata);
    },
  };
}

internals.enableJupyter = enableJupyter;