Description
browser-run runs code inside a browser environment from the command line, so you can test or run browser code without setting up a page yourself. It starts a small web server and opens a browser that loads your code, and console output from the page is forwarded to your terminal. Electron is the default browser and is bundled with the tool. The README also lists chrome, firefox, ie and safari as options when they are installed. You can use it as a CLI or from code, where the run function returns a duplex stream and starts the web server. Options let you serve a static directory, set a port so you can open your own browser to the server, or supply a custom HTML file as the input. A dynamic back-end mock lets you handle requests to paths that start with /mock, using a file that exports a function taking request and response arguments. The README includes examples with browserify. The source is public on GitHub and the project accepts contributions.…
Highlights
- Runs code in a browser from the command line
- Electron bundled by default
- Console output forwarded to the terminal
- Custom HTML files and static directories
- Mock back-end routes under /mock
Ratings & Reviews
No ratings yet
Be the first to rate Browser Run.
People also visit
Browser Run FAQ
What is browser-run?
A command line tool and Node module for running code in a browser environment, with the page's console output shown in your terminal.
Which browsers can it use?
Electron is the default and is bundled. The README also lists chrome, firefox, ie and safari as options when they are installed.
Can I use my own HTML page?
Yes. Use --input html or the input option. The README says the custom page needs a browser-run script tag above your other scripts so logs reach the terminal.
Can I mock a back end?
Yes. Pass --mock with a file that exports a function taking req and res. It handles requests to paths beginning with /mock.
Can I use it from my own code?
Yes. The run function accepts options such as port, browser, static, mock and input, and returns a duplex stream.
What are the best Browser Run alternatives?
Popular alternatives to Browser Run include Pocket Mocker, Runno and Tape Run. See all Browser Run alternatives











