RangerMauve / webrun

Run Web-first ESM modules outside of the browser
https://webrun-presentation.hashbase.io/
MIT License
77 stars 8 forks source link

Added a REPL and support for `import()` #6

Closed RangerMauve closed 6 years ago

RangerMauve commented 6 years ago

Did some sooky magic by hacking the rempl module to run things in the webrun context.

Also added something for intercepting calls to import() in order to rewrite it to import.meta._import which will load the module.

As well we now have a _import global which will import relative to the process.cwd(). This is there for supporting import() in the REPL.

You can run the repl by runnin webrun without a URL to load, e.g. webrun.