open-index/open-npm huggingface dataset:
npm package: @rsc-parser/core
Description: > [!WARNING] > This package is published on npm as `@rsc-parser/core` but its api cannot be considered stable. For now, there will be no guarantees about API stability. See `@rsc-parser/embedded` for a more stable package that you can use in your projects
Author: Alvar Lagerlöf
Latest version: 1.1.2

# @rsc-parser/core

> [!WARNING]
> This package is published on npm as `@rsc-parser/core` but its api cannot be considered stable. For now, there will be no guarantees about API stability. See `@rsc-parser/embedded` for a more stable package that you can use in your projects.
npm package: @rsc-xray/hydration
Description: React hook for measuring client component hydration performance: track timing and costs per island
Latest version: 0.8.0

[![npm](https://img.shields.io/npm/v/@rsc-xray/hydration.svg)](https://www.npmjs.com/package/@rsc-xray/hydration)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/hydration.svg)](https://www.npmjs.com/package/@rsc-xray/hydration)

# @rsc-xray/hydration

[![npm](https://img.shields.io/npm/v/@rsc-xray/hydration.svg)](https://www.npmjs.com/package/@rsc-xray/hydration)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/hydration.svg)](https://www.npmjs.com/package/@rsc-xray/hydration)

Tiny helper library that records hydration timings for client components and exposes a hook that plugs into React.

## What it solves

- Marks hydration start/end for each island using the Performance API.
- Provides a React hook (`createHydrationHook`) that instruments components with minimal boilerplate.
- Returns aggregated timings so the analyzer and overlay can display hydration costs per route.

## Installation

```bash
pnpm add @rsc-xray/hydration
```

## Step-by-step usage

1. **Create the hook once**

   ```ts
   import { createHydrationHook } from '@rsc-xray/hydration';
   import { useEffect, useRef } from 'react';

   export const useHydrationTimings = createHydrationHook({ useEffect, useRef });
   ```

2. **Instrument client components**

   ```tsx
   'use client';
   import { useHydrationTimings } from './hooks/useHydrationTimings';

   export function ProductGrid() {
     useHydrationTimings('product-grid');
     return <div>...</div>;
   }
   ```

3. **Read timings when needed**

   ```ts
   import { getHydrationDurations } from '@rsc-xray/hydration';

   const durations = getHydrationDurations();
   console.log(durations['product-grid']);
   ```

4. **Reset between navigations/tests**
   ```ts
   import { resetHydrationMetrics } from '@rsc-xray/hydration';
   resetHydrationMetrics();
   ```

## Tests

- `packages/hydration/src/__tests__/hydration.test.tsx` verifies the hook API and timing collection end-to-end, mirroring the steps above.

Run the suite with:

```bash
pnpm -F @rsc-xray/hydration test -- --run
```

### RSC X‑Ray Pro

Paid plans available — unlock the full toolkit:

- Overlay UI — live boundary tree, Suspense markers, bundle bytes, hydration timings
- Flight tap & timeline — capture React Flight streaming; visualize chunk order, sizes, labels
- Cache lens — inspect `tags`, revalidate policies, and route impact
- Waterfall detector — find sequential awaits; guided fixes (preload/parallelize)
- Codemods — `use client`, wrap with Suspense, add preload/hydration hook
- VS Code extension — analyzer diagnostics + “Open in XRay” deep links
- CI budgets & trends — PR comments, thresholds, and historical deltas

Learn more → https://rsc-xray.dev • Pricing → https://rsc-xray.dev/pricing
npm package: @rsc-xray/report-html
Description: Generate offline HTML reports for RSC X-Ray analysis: visualize boundaries, Suspense, bundle sizes, and optimization suggestions
Latest version: 0.8.0

[![npm](https://img.shields.io/npm/v/@rsc-xray/report-html.svg)](https://www.npmjs.com/package/@rsc-xray/report-html)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/report-html.svg)](https://www.npmjs.com/package/@rsc-xray/report-html)

# @rsc-xray/report-html

[![npm](https://img.shields.io/npm/v/@rsc-xray/report-html.svg)](https://www.npmjs.com/package/@rsc-xray/report-html)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/report-html.svg)](https://www.npmjs.com/package/@rsc-xray/report-html)

HTML renderer for the `model.json` contract produced by the analyzer. Generates a static, shareable report without any server dependency.

## What it solves

- Converts analyzer output into an interactive HTML artifact that teams can open locally or publish from CI.
- Highlights server/client boundaries, Suspense nodes, bytes per island, diagnostics, and suggestions.
- Ships as an ESM module so it can run in Node or bundle into other tooling.

## Installation

```bash
pnpm add -D @rsc-xray/report-html
```

## Step-by-step usage

1. Generate `model.json` using the CLI or analyzer API.
2. Render the report:

   ```ts
   import { renderReport } from '@rsc-xray/report-html';
   import fs from 'node:fs/promises';

   const model = JSON.parse(await fs.readFile('model.json', 'utf8'));
   const html = renderReport({ model });
   await fs.writeFile('report.html', html, 'utf8');
   ```

3. Open `report.html` in any browser or upload it as a CI artifact.

Prefer the CLI? Run:

```bash
pnpm -F @rsc-xray/cli report --model ./model.json --out ./report.html
```

## Tests

- `packages/report-html/src/__tests__/renderReport.test.ts` snapshots the generated HTML to guarantee parity with the documented workflow.

Run the suite with:

```bash
pnpm -F @rsc-xray/report-html test -- --run
```

### RSC X‑Ray Pro

Paid plans available — unlock the full toolkit:

- Overlay UI — live boundary tree, Suspense markers, bundle bytes, hydration timings
- Flight tap & timeline — capture React Flight streaming; visualize chunk order, sizes, labels
- Cache lens — inspect `tags`, revalidate policies, and route impact
- Waterfall detector — find sequential awaits; guided fixes (preload/parallelize)
- Codemods — `use client`, wrap with Suspense, add preload/hydration hook
- VS Code extension — analyzer diagnostics + “Open in XRay” deep links
- CI budgets & trends — PR comments, thresholds, and historical deltas

Learn more → https://rsc-xray.dev • Pricing → https://rsc-xray.dev/pricing
npm package: @rsc-xray/schemas
Description: TypeScript types and JSON schema for RSC X-Ray model: shared contracts for analyzer, CLI, and reporting tools
Latest version: 0.8.0

[![npm](https://img.shields.io/npm/v/@rsc-xray/schemas.svg)](https://www.npmjs.com/package/@rsc-xray/schemas)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/schemas.svg)](https://www.npmjs.com/package/@rsc-xray/schemas)

# @rsc-xray/schemas

[![npm](https://img.shields.io/npm/v/@rsc-xray/schemas.svg)](https://www.npmjs.com/package/@rsc-xray/schemas)
[![Downloads](https://img.shields.io/npm/dm/@rsc-xray/schemas.svg)](https://www.npmjs.com/package/@rsc-xray/schemas)

Shared TypeScript types and JSON schema that define the `model.json` contract between the analyzer, CLI, HTML report, and Pro tooling.

## What it solves

- Provides canonical TypeScript types (`Model`, `XNode`, etc.) so packages can share a single source of truth.
- Exposes a JSON schema suitable for runtime validation (used by the CLI and CI workflows).
- Keeps the OSS analyzer and Pro overlay in lockstep when the model evolves.

## Installation

```bash
pnpm add -D @rsc-xray/schemas
```

## Step-by-step usage

1. **Import the types** where you consume `model.json`:

   ```ts
   import type { Model } from '@rsc-xray/schemas';

   const model: Model = JSON.parse(await fs.promises.readFile('model.json', 'utf8'));
   ```

2. **Validate at runtime** (optional but recommended):

   ```ts
   import Ajv from 'ajv';
   import { modelSchema } from '@rsc-xray/schemas';

   const ajv = new Ajv({ allErrors: true });
   const validate = ajv.compile(modelSchema);
   if (!validate(model)) {
     throw new Error(ajv.errorsText(validate.errors));
   }
   ```

3. **Sync with the CLI/analyzer** — both rely on this package, so your code stays compatible as long as you import the same version.

## Tests

- `packages/cli/src/commands/__tests__/analyze.test.ts` and `packages/cli/src/commands/__tests__/report.test.ts` validate models against this schema.
- `packages/schemas/src/index.test.ts` snapshots the exported schema to prevent accidental breaking changes.

Run the schema tests with:

```bash
pnpm -F @rsc-xray/schemas test -- --run
```

### RSC X‑Ray Pro

Paid plans available — unlock the full toolkit:

- Overlay UI — live boundary tree, Suspense markers, bundle bytes, hydration timings
- Flight tap & timeline — capture React Flight streaming; visualize chunk order, sizes, labels
- Cache lens — inspect `tags`, revalidate policies, and route impact
- Waterfall detector — find sequential awaits; guided fixes (preload/parallelize)
- Codemods — `use client`, wrap with Suspense, add preload/hydration hook
- VS Code extension — analyzer diagnostics + “Open in XRay” deep links
- CI budgets & trends — PR comments, thresholds, and historical deltas

Learn more → https://rsc-xray.dev • Pricing → https://rsc-xray.dev/pricing
npm package: @rsc/prettier-config
Description: RSC Prettier Config
Author: David Angel
Latest version: 0.0.3

# `@rsc/prettier-config`

> RSC [Prettier](https://prettier.io) Config.

## Usage

**Install**:

```bash
$ npm install --save-dev @rsc/prettier-config
```

**Edit `package.json`**:

```jsonc
{
  // ...
  "prettier": "@rsc/prettier-config"
}
```
npm package: @rschaosid/delay
Description: promise setTimeout with cancel and unref
Author: rschaosid
Latest version: 1.1.2

#@rschaosid/delay

This is my setTimeout. There are many like it, but this one is mine.

```javascript
import delay from '@rschaosid/delay';

// do something after one second
delay(1000)[0].then(function() {
  console.log('one second later');
});

// do something after one second, without holding the event loop open
delay(1000, { unref: true })[0].then( ... );

// don't do something after one second
let [ promise, cancel ] = delay(1000);
cancel('aborted');
promise.catch(function(e) {
  // e === 'aborted'
});
```