# cdp-web

> Provides a lightweight way to communicate with the Chrome DevTools Protocol (CDP).

Latest version **1.0.3** (published 2023-11-12) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install cdp-web
pnpm add cdp-web
yarn add cdp-web
bun add cdp-web
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2023-11-12 |
| First published | 2023-11-12 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 1 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | eliassko |
| Keywords | chrome, devtools, cdp, chrome-devtools-protocol |

## Links

- npm: https://www.npmjs.com/package/cdp-web
- Repository: https://github.com/tscpp/cdp-web
- Homepage: https://github.com/tscpp/cdp-web#readme
- Issues: https://github.com/tscpp/cdp-web/issues
- npm.io page: https://npm.io/package/cdp-web

## Dependencies (1)

- [websocket-polyfill](https://npm.io/package/websocket-polyfill.md) ^0.0.3

## Recent versions

- 1.0.3 (latest) — 2023-11-12
- 1.0.2 — 2023-11-12
- 1.0.1 — 2023-11-12
- 1.0.0 — 2023-11-12

## README

# cdp-web

This library provides a lightweight way to communicate with the [Chrome DevTools Protocol](https://chromedevtools.github.io/devtools-protocol/) (CDP). Supports browsers, Deno, Node, and Bun. Less than 2KB minified.

```javascript
import { createCdpConnection } from "cdp-web";

const cdp = await createCdpConnection({
  url: "http://localhost:9222", // optional, default value
  target: "page", // optional, default value
});

// Send 'Tracing.getCategories' command and wait for the result.
const categories = await cdp.send("Tracing.getCategories");

// Listen for all CDP events.
cdp.addEventListener("message", (event) => {
  if (event.method === "Tracing.dataCollected") {
    // Handle 'Tracing.dataCollected' event.
    console.log(event.params);
  }
});
```

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