# braids

> A tool to get data about a site's performance and network requests

Latest version **0.0.4** (published 2020-02-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install braids
pnpm add braids
yarn add braids
bun add braids
```

Provides the command `braids`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2020-02-16 |
| First published | 2020-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 21.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ryan Hinchey |
| Maintainers | ryhinchey |
| Keywords | web performance, puppeteer, performance analytics |

## Links

- npm: https://www.npmjs.com/package/braids
- npm.io page: https://npm.io/package/braids

## Dependencies (2)

- [commander](https://npm.io/package/commander.md) 4.1.0
- [puppeteer](https://npm.io/package/puppeteer.md) 2.0.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2020-02-16
- 0.0.3 — 2020-02-16
- 0.0.2 — 2020-02-16
- 0.0.1 — 2020-01-22

## README

# Braids 

> A node module and cli to get data about a site's performance and network requests

## Installation
```sh
npm install braids
```

## Data

Each call to `run` will return the following data:

```typescript
interface SiteData {
  url: string;
  title: string; // document.title
  performance: {
    entries: PerformanceEntryList; // array of performance entries.  return value of window.performance.getEntries()
    timing: PerformanceResourceTiming; // performance timing object.  return value of window.perormance.timing
  };
  coverage: {
    [url: string]: { // each resource loaded by the page will be included
      usedBytes: number;
      totalBytes: number;
    };
  };
  requests: {
    url: string;
    method: HttpMethod; // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/puppeteer/v1/index.d.ts#L928
    headers: Headers; // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/puppeteer/v1/index.d.ts#L927
    resourceType: ResourceType; // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/puppeteer/v1/index.d.ts#L936
    response?: {
      status: number;
      headers: Headers; // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/puppeteer/v1/index.d.ts#L92
    };
  }[]

}
```


## Module Usage example

```javascript
import { startBrowser, run, stopBrowser } from 'braids';

async function getMySiteData() {
  await startBrowser();

  const mySiteData = await run('http://www.mysite.com');
  const mySiteData2 = await run('http://www.mysite2.com');

  stopBrowser();
}
```

## CLI Usage Example
```bash
braids run http://www.mysite.com > mysite.json
```

## Development setup

```sh
npm install
npm build
```

## Meta

Ryan Hinchey – [@ryhinchey](https://twitter.com/ryhinchey) 

Distributed under the MIT license. See ``LICENSE.txt`` for more information.

[https://github.com/ryhinchey/braids](https://github.com/ryinchey/braids)

## Contributing

1. Fork it (<https://github.com/rhinchey/braids/fork>)
2. Create your feature branch (`git checkout -b feature/new-feature`)
3. Commit your changes (`git commit -am 'Add a new feature'`)
4. Push to the branch (`git push origin feature/new-feature`)
5. Create a new Pull Request

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