This is the guts of https://svelte.dev/repl, extracted into its own package so that it can be used elsewhere.
MIT