
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
browser-run2
Advanced tools
Transform stream that executes JavaScript it receives in a real browser and outputs console output
The easiest way of running code in a browser environment.
Same as juliangruber/browser-run, but uses benderjs/browser-launcher2 instead of substack/browser-launcher, due to substack/browser-launcher/issues/34.
$ npm install browser-run2 # for library
$ npm install -g browser-run2 # for cli
$ echo "console.log('Hey there from ' + document.location)" | browser-run
Hey there from http://localhost:53227/
Or use browser-run programmatically:
var run = require('browser-run2');
var browser = run();
browser.pipe(process.stdout);
browser.write('console.log(document.location)');
browser.end();
$ browserify main.js | browser-run
or
var browserify = require('browserify');
var browser = require('browser-run2');
browserify('main.js').bundle().pipe(browser()).pipe(process.stdout);
$ browser-run --help
Run JavaScript in a browser.
Write code to stdin and receive console output on stdout.
Usage: browser-run [OPTIONS]
Options:
--browser, -b Browser to use. Available if installed: chrome, firefox, ie, phantom, safari [default: "phantom"]
--port, -p Starts listening on that port and waits for you to open a browser
--help, -h Print help
Returns a duplex stream and starts a webserver.
opts can be:
port: If speficied, no browser will be started, so you can point one yourself to http://localhost/<port>browser: Browser to use. Defaults to phantom. Available if installed:
chromefirefoxiephantomsafariStop the underlying webserver.
MIT
FAQs
Transform stream that executes JavaScript it receives in a real browser and outputs console output
The npm package browser-run2 receives a total of 11 weekly downloads. As such, browser-run2 popularity was classified as not popular.
We found that browser-run2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.