Jupyter
Create interactive notebooks and execute code cells. Useful for data analysis, visualization, and educational purposes.
Eg Deno.jupyter
function Deno.jupyter.broadcast
broadcast(
msgType: string,
content: Record<string, unknown>,
extra?: { metadata?: Record<string, unknown>; buffers?: Uint8Array[]; },
): Promise<void>Broadcast a message on IO pub channel.
await Deno.jupyter.broadcast("display_data", {
data: { "text/html": "<b>Processing.</b>" },
metadata: {},
transient: { display_id: "progress" }
});
await new Promise((resolve) => setTimeout(resolve, 500));
await Deno.jupyter.broadcast("update_display_data", {
data: { "text/html": "<b>Processing..</b>" },
metadata: {},
transient: { display_id: "progress" }
});
Parameters
msgType: string content: Record<string, unknown> extra: { metadata?: Record<string, unknown>; buffers?: Uint8Array[]; } Return Type
Promise<void> function Deno.jupyter.display
display(
obj: unknown,
options?: DisplayOptions,
): Promise<void>Display function for Jupyter Deno Kernel. Mimics the behavior of IPython's display(obj, raw=True) function to allow asynchronous displaying of objects in Jupyter.
Parameters
obj: unknown - The object to be displayed
options: DisplayOptions - Display options with a default { raw: true }
Return Type
Promise<void> function Deno.jupyter.format
format(obj: unknown): Promise<MediaBundle>Format an object for displaying in Deno
Parameters
obj: unknown - The object to be displayed
Return Type
Promise<MediaBundle> Promise
function Deno.jupyter.html
html(
strings: TemplateStringsArray,
...values: unknown[],
): DisplayableShow HTML in Jupyter frontends with a tagged template function.
Takes a template string and returns a displayable object for Jupyter frontends.
Examples
const { html } = Deno.jupyter;
html`<h1>Hello, world!</h1>`
Parameters
strings: TemplateStringsArray ...values: unknown[] Return Type
function Deno.jupyter.image
Overload 1
image(path: string): DisplayableDisplay a JPG or PNG image.
Deno.jupyter.image("./cat.jpg");
Deno.jupyter.image("./dog.png");
Parameters
path: string Return Type
Overload 2
image(data: Uint8Array): DisplayableDisplay a JPG or PNG image.
const img = Deno.readFileSync("./cat.jpg");
Deno.jupyter.image(img);
Parameters
data: Uint8Array Return Type
function Deno.jupyter.md
md(
strings: TemplateStringsArray,
...values: unknown[],
): DisplayableShow Markdown in Jupyter frontends with a tagged template function.
Takes a template string and returns a displayable object for Jupyter frontends.
Examples
const { md } = Deno.jupyter;
md`# Notebooks in TypeScript via Deno 
* TypeScript ${Deno.version.typescript}
* V8 ${Deno.version.v8}
* Deno ${Deno.version.deno}
Interactive compute with Jupyter _built into Deno_!
`
Parameters
strings: TemplateStringsArray ...values: unknown[] Return Type
function Deno.jupyter.svg
svg(
strings: TemplateStringsArray,
...values: unknown[],
): DisplayableSVG Tagged Template Function.
Takes a template string and returns a displayable object for Jupyter frontends.
Example usage:
svg<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /> </svg>
Parameters
strings: TemplateStringsArray ...values: unknown[] Return Type
interface Deno.jupyter.Displayable
Properties
[$display]: () => MediaBundle | Promise<MediaBundle> interface Deno.jupyter.MediaBundle
A collection of supported media types and data for Jupyter frontends.
Index Signatures
| object
| undefined
Properties
text/plain: string text/html: string image/svg+xml: string text/markdown: string application/javascript: string image/png: string image/jpeg: string image/gif: string application/pdf: string application/json: object application/geo+json: object application/vdom.v1+json: object application/vnd.plotly.v1+json: object application/vnd.vega.v5+json: VegaObject application/vnd.vegalite.v4+json: VegaObject application/vnd.vegalite.v5+json: VegaObject interface Deno.jupyter.VegaObject
Index Signatures
Properties
$schema: string namespace Deno.jupyter
A namespace containing runtime APIs available in Jupyter notebooks.
When accessed outside of Jupyter notebook context an error will be thrown.
Functions
Broadcast a message on IO pub channel.
Display function for Jupyter Deno Kernel. Mimics the behavior of IPython's display(obj, raw=True) function to allow asynchronous displaying of objects in Jupyter.
Format an object for displaying in Deno
Show HTML in Jupyter frontends with a tagged template function.
Display a JPG or PNG image.
Show Markdown in Jupyter frontends with a tagged template function.
SVG Tagged Template Function.
Interfaces
A collection of supported media types and data for Jupyter frontends.
- application/geo+json
- application/javascript
- application/json
- application/pdf
- application/vdom.v1+json
- application/vnd.plotly.v1+json
- application/vnd.vega.v5+json
- application/vnd.vegalite.v4+json
- application/vnd.vegalite.v5+json
- image/gif
- image/jpeg
- image/png
- image/svg+xml
- text/html
- text/markdown
- text/plain
Variables
© 2018–2025 the Deno authors
Licensed under the MIT License.
https://docs.deno.com/api/deno/jupyter