If you want to tinker with examples, you have many options on how to run the code:
At the time of writing, native Node ES Modules support is still flaky, using plain repl call like
node leave-only-html.js might not work — use
esm which we call via
-r flag like this:
node -r esm leave-only-html.js.
git clonethe monorepo and
npm iand then
cdinto the package's folder, you can execute each example file using a Node repl, for example:
node -r esm leave-only-html.js. If there are no errors, nothing should happen — asserts succeeded!
package.jsonof each program has an npm script
test:exampleswhich calls the example test runner which gives some UI in the terminal, you get feedback of each example testing outcome. To run it,
cdinto a package's folder in cloned monorepo and
npm run test:examples.
You can use CodeSandbox — copy-paste the example code into the sandbox, manually adding all imported dependencies.
You could use Runkit , but it doesn't support ES Modules (
import), so you'd have to replace all imports with CommonJS equivalents, with
const foo = require("bar").