You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run any JavaScript or TypeScript code in a headless browser using puppeteer and pipe it's output back to your terminal 🔥
7
+
Run any JavaScript / TypeScript code in a headless browser using [Puppeteer](https://github.com/GoogleChrome/puppeteer) and pipe its output to your terminal 🔥
8
8
9
9
Transparently bundles input files, so you can use `require()` and ES module imports. You can even simulate connectivity issues and serve static files. Great for testing client-side code in an actual browser!
10
10
11
11
How does it relate to [Karma](https://karma-runner.github.io)? It's everything that Karma is not: It's small, it's fast and trivial to set up.
12
12
13
-
🚀 Runs any script in a headless Chrome<br />
13
+
🚀 Runs any script in a headless Chrome browser<br />
⚙️ Uses existing Babel, TypeScript, ... config if present<br />
16
15
💡 Supports TypeScript, ES modules & JSX out of the box<br />
17
16
🖥 Pipes console output and errors to host shell<br />
17
+
⚙️ Uses custom Babel, TypeScript, ... config if present<br />
18
18
19
19
20
20
## Installation
@@ -36,7 +36,7 @@ npx puppet-run [<arguments>]
36
36
node ./node_modules/.bin/puppet-run [<arguments>]
37
37
```
38
38
39
-
Pass any JavaScript or TypeScript file to `puppet-run` as an entrypoint. It will be transpiled by Babel using `@babel/preset-env`, `@babel/preset-react` & `@babel/preset-typescript`and bundled using `browserify`. It normally works out-of-the-box with zero configuration.
39
+
Pass any JavaScript or TypeScript file to `puppet-run` as an entrypoint. It will be transpiled by Babel and bundled using `browserify`. It normally works out-of-the-box with zero configuration.
@@ -74,7 +74,7 @@ console.log(`I am being run in a browser: ${navigator.userAgent}`)
74
74
puppet.exit()
75
75
```
76
76
77
-
Don't forget to call `puppet.exit()` when the script is done, so `puppet-run` knows that the script is finished. You can also exit with a non-zero exit code using `puppet.exit(statusCode: number)`.
77
+
Don't forget to call `puppet.exit()` when the script is done, so `puppet-run` knows that the script has finished. You can also exit with a non-zero exit code using `puppet.exit(statusCode: number)`.
78
78
79
79
Check out the "Scripting API" section below if you want to learn more about the globally available `puppet` object.
0 commit comments