0.5.2 ā€¢ Published 9 months ago

@runno/host v0.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

šŸ‘Øā€šŸ’» Use Runno šŸ‘‰ Runno.dev

šŸ“– Documentation šŸ‘‰ Runno.dev

Runno Host

This packages is meant to be used in concert with a https://runno.run client iframe. The easiest way to create one is on the Runno Website.

Quickstart

Start by adding @runno/host to your package:

$ npm install @runno/host

Then you'll be able to import ConnectRunno.

import { ConnectRunno } from '@runno/host'

And use it with an existing Runno iframe.

const runno = await ConnectRunno(iframe);

To run a code sample interactively use interactiveRunCode.

const result = await runno.interactiveRunCode("python", codeSample);

The result has properties for stdin, stdout, stderr, tty, and fs (the file system). This represents the input that the user has typed, the output they received, any errors displayed and the full terminal text (input, output and errors).

If you want to run code without user input or output, you can use headlessRunCode.

const result = await runno.headlessRunCode("python", codeSample, stdin);

The stdin is optional, but necessary if the code expects input.

Cross-Origin Headers

To get the best experience your page should provide a Cross-Origin Isolated context so it can internally use SharedArrayBuffer. Without this Runno falls back to a lower performance hack that has the potential to break in the future.

To make your website Cross-Origin Isolated set the following headers in your HTTP response:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

You can test that your page is Cross-Origin Isolated by opening the browser console and checking crossOriginIsolated (see: mdn docs).

0.5.2

9 months ago

0.5.1

10 months ago

0.5.0

11 months ago

0.4.1

11 months ago

0.4.0

11 months ago

0.4.3

11 months ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago