terrarium-stream

a stream-based wrapper for Terrarium

Usage no npm install needed!

<script type="module">
  import terrariumStream from 'https://cdn.skypack.dev/terrarium-stream';
</script>

README

terrarium-stream

This is an interface to terrarium that provides a readable & writable stream. Send it JavaScript code with instrumentation hints (//=value) and it sends you back messages when those values are ready. Automatically it destroys and creates sandboxes to fix the problem of runaway setInterval usage.

Like Terrarium, it provides browser and node contexts, and exposes them under .Node and .Browser

Examples

With a shoe stream, evaluating code on a server:

stream.pipe(terrariumStream()).pipe(stream);