Skip to content

geut/brode

Repository files navigation

brode

Monorepo project for the polyfill Node.js browser platform: brode 🤜 🤛

Test Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Intro

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.

Example

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:

  1. Compiles the index.js with esbuild.
  2. Adds polyfills for every Node.js core module/globals.
  3. 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. 🤜 🤛

Modules

  • 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.

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

About

A polyfill Node.js runner for the browser

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •