Monorepo project for the polyfill Node.js browser platform: brode
🤜 🤛
In Geut we are constantly creating Node.js modules with browser support and when is time to test one of those modules we have to think:
How I'm going to test a JavaScript module in Chrome/Firefox?
That's why we created brode
.
In summary, brode
is a command-line tool that allows you to run JavaScript files in the browser on top of a Node.js polyfill environment.
Take a look at this example, here we are testing some code that will run on firefox:
// index.js
process.stdout.write('hello world')
process.exit(0)
$ node index.js
$ hello world
$
$ brode index.js --target firefox
$ hello world
brode index.js --target firefox
brode
is doing the following for you:
- Compiles the
index.js
with esbuild. - Adds polyfills for every Node.js core module/globals.
- Runs the build with playwright.
With brode
you can use test runners like uvu to test your modules in Node.js and browsers.
Quick, small and easy. 🤜 🤛
- brode: Command-line tool and API for the polyfill Node.js browser platform.
- brout: Command-line tool and API to log the output of JavaScript files using playwright.
- browser-node-core: Core Node modules for the browser.
- esbuild-plugin-brode: A esbuild plugin to add web polyfills to support node core modules and globals.
- esbuild-plugin-server: A esbuild plugin to run a dev server.
🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.
👥 Ideas and contributions to the project are welcome. You must follow this guideline.
MIT © A GEUT project