# playwright-start

> Start a Playwright browser server via CLI

Latest version **1.1.0** (published 2021-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install playwright-start
pnpm add playwright-start
yarn add playwright-start
bun add playwright-start
```

Provides the command `playwright-start`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-04-24 |
| First published | 2021-02-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | Hiroki Osame |
| Maintainers | hirokiosame |
| Keywords | playwright, cli, start, browser, server |

## Links

- npm: https://www.npmjs.com/package/playwright-start
- Repository: https://github.com/privatenumber/playwright-start
- Homepage: https://github.com/privatenumber/playwright-start#readme
- Issues: https://github.com/privatenumber/playwright-start/issues
- Funding: https://github.com/privatenumber/playwright-start?sponsor=1
- npm.io page: https://npm.io/package/playwright-start

## Dependencies (2)

- [cac](https://npm.io/package/cac.md) ^6.7.1
- [exit-hook](https://npm.io/package/exit-hook.md) ^2.2.0

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2021-04-24
- 1.0.0 — 2021-02-17

## README

# playwright-start [![Latest version](https://badgen.net/npm/v/playwright-start)](https://npm.im/playwright-start) [![Monthly downloads](https://badgen.net/npm/dm/playwright-start)](https://npm.im/playwright-start)

Start a long-running [Playwright](https://playwright.dev) browser server via CLI.

<sub>If you like this project, please star it & [follow me](https://github.com/privatenumber) to see what other cool projects I'm working on! ❤️</sub>

## 🙋‍♂️ Why?
When developing browser automation scripts, there's a lot of overhead in browser start up every time you test a change.

Start a long-running browser server in a separate window and connect to it from your script to iterate faster! The CLI also comes with a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) to help you quickly test code.

## 🚀 Install
```sh
npm i -D playwright-start
```

## 🚦 Quick Setup
1. Start a browser server from a separate terminal session:
	```sh
	npx playwright-start
	```

2. Connect from your code:
	```ts
	import {
	    ChromiumBrowser,
	    devices,
	} from 'playwright'
	import connect from 'playwright-start'

	(async () => {
	    const browser = await connect<ChromiumBrowser>()

	    const context = await browser.newContext({
	        // Emulate Pixel 2 XL
	        ...devices['Pixel 2 XL']
	    })

	    const page = await context.newPage()

	    // ...
	})()
	```

## 👨‍🏫 Examples

### Starting a non-headless Chromium server

```sh
npx playwright-start --headless=false
```

### Starting a Firefox or Webkit server

Firefox:
```sh
npx playwright-start firefox
```

Webkit:
```sh
npx playwright-start webkit
```

---
_Source: https://npm.io/package/playwright-start · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
