open-index/open-npm huggingface dataset:
npm package: @liteguard/core
Description: Shared Liteguard runtime primitives and generated wire types. Internal package used by @liteguard/liteguard-node, @liteguard/liteguard-browser, and @liteguard/liteguard-react
Latest version: 0.6.20260405

# @liteguard/core

[![JavaScript SDK](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml/badge.svg)](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml)
[![npm](https://img.shields.io/npm/v/@liteguard/core)](https://www.npmjs.com/package/@liteguard/core)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/liteguard/liteguard/blob/main/LICENSE)

Shared runtime primitives and generated wire types for the Liteguard JavaScript SDK family.

This is an **internal package** consumed by `@liteguard/liteguard-node`, `@liteguard/liteguard-browser`, and `@liteguard/liteguard-react`. Unless you are building a custom Liteguard runtime adapter, you should install one of those packages instead.

---

## Contents

- Guard evaluation engine (rule matching, operator evaluation, first-match-wins semantics)
- Signal buffer and flush logic
- Generated TypeScript types derived from `proto/liteguard.proto`
- HTTP client primitives for guard rule fetching and signal submission
- Rate limiting state management

---

## Related packages

| Package | Description |
|---|---|
| [`@liteguard/liteguard`](https://www.npmjs.com/package/@liteguard/liteguard) | Umbrella package. Automatic runtime resolution |
| [`@liteguard/liteguard-node`](https://www.npmjs.com/package/@liteguard/liteguard-node) | Node.js runtime |
| [`@liteguard/liteguard-browser`](https://www.npmjs.com/package/@liteguard/liteguard-browser) | Browser runtime |
| [`@liteguard/liteguard-react`](https://www.npmjs.com/package/@liteguard/liteguard-react) | React bindings |

---

## License

Apache 2.0 see [LICENSE](https://github.com/liteguard/liteguard/blob/main/LICENSE).
npm package: @liteguard/liteguard
Description: Liteguard SDK. Feature guards, observability, and security response in a single import. Resolves to the Node.js or browser runtime automatically.
Latest version: 0.6.20260405

# @liteguard/liteguard

[![JavaScript SDK](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml/badge.svg)](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml)
[![npm](https://img.shields.io/npm/v/@liteguard/liteguard)](https://www.npmjs.com/package/@liteguard/liteguard)

- Website: [liteguard.io](https://liteguard.io)
- Project Page: [https://github.com/liteguard/liteguard](https://github.com/liteguard/liteguard)
- Issues: [https://github.com/liteguard/liteguard/issues/new](https://github.com/liteguard/liteguard/issues/new)

Umbrella package for the Liteguard JavaScript SDK.

## Installation

```bash
npm install @liteguard/liteguard
```

## Quick Start

```ts
import { LiteguardClient } from "@liteguard/liteguard";

const client = new LiteguardClient("pct-...", {
  environment: "env-production",
});
await client.start();

const scope = client.createScope({ userId: "user-123", plan: "pro" });

if (scope.isOpen("payments.checkout")) {
  // ...
}

await client.shutdown();
```

## Packages

| Package | Use when |
|---|---|
| `@liteguard/liteguard` | You want automatic runtime resolution |
| `@liteguard/liteguard-node` | Node.js servers, workers, CLIs |
| `@liteguard/liteguard-browser` | Browser applications |
| `@liteguard/liteguard-react` | React components and hooks |

## Primary API

This package exposes the same explicit-client API as the runtime-specific packages:

- `new LiteguardClient(projectClientToken, options)` creates a client.
- `await client.start()` fetches the initial bundle and starts refresh and flush workers.
- `client.createScope()`
- `scope.isOpen()`
- `scope.evaluate()` returns a `GuardDecision` with the full evaluation result.
- `scope.executeIfOpen()` / `scope.executeIfOpenAsync()`
- `scope.startExecution()` creates an execution correlation handle.
- `scope.withProperties()` / `scope.withProtectedContext()`
- `scope.getProperties()` returns the current property bag for transport.
- `client.flush()`
- `client.shutdown()`

## License

Apache 2.0 see [LICENSE](https://github.com/liteguard/liteguard/blob/main/LICENSE).
npm package: @liteguard/liteguard-browser
Description: Liteguard SDK for browser runtimes. Feature guards, observability, and security response evaluated locally with zero network overhead per check
Latest version: 0.6.20260405

# @liteguard/liteguard-browser

[![JavaScript SDK](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml/badge.svg)](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml)
[![npm](https://img.shields.io/npm/v/@liteguard/liteguard-browser)](https://www.npmjs.com/package/@liteguard/liteguard-browser)

- Website: [liteguard.io](https://liteguard.io)
- Project Page: [https://github.com/liteguard/liteguard](https://github.com/liteguard/liteguard)
- Issues: [https://github.com/liteguard/liteguard/issues/new](https://github.com/liteguard/liteguard/issues/new)

Liteguard for browser runtimes.

## Installation

```bash
npm install @liteguard/liteguard-browser
```

## Quick Start

```ts
import { LiteguardClient } from "@liteguard/liteguard-browser";

const client = new LiteguardClient("pct-...", {
  environment: "env-production",
});
await client.start();

const scope = client.createScope({ userId: "user-123", plan: "pro" });

if (scope.isOpen("payments.checkout")) {
  // ...
}

await client.shutdown();
```

## Primary API

- `new LiteguardClient(projectClientToken, options)` creates a client.
- `await client.start()` fetches the initial bundle and starts refresh and flush workers.
- `client.createScope()` creates an immutable scope.
- `scope.isOpen()` evaluates locally.
- `scope.evaluate()` returns a `GuardDecision` with the full evaluation result.
- `scope.executeIfOpen()` and `scope.executeIfOpenAsync()` measure guarded work.
- `scope.startExecution()` creates an execution correlation handle.
- `scope.withProperties()` and `scope.withProtectedContext()` derive child scopes.
- `scope.getProperties()` returns the current property bag for transport.
- `client.flush()` flushes buffered telemetry.
- `client.shutdown()` flushes and stops background work.

## Notes

- Prefer explicit scopes for async browser flows.
- Evaluation is local after the initial bundle fetch.
- Unadopted guards default open and emit no signals.

## License

Apache 2.0 see [LICENSE](https://github.com/liteguard/liteguard/blob/main/LICENSE).
npm package: @liteguard/liteguard-node
Description: Liteguard SDK for Node.js runtimes. Feature guards, observability, and security response evaluated locally with zero network overhead per check
Latest version: 0.6.20260405

# @liteguard/liteguard-node

[![JavaScript SDK](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml/badge.svg)](https://github.com/liteguard/liteguard/actions/workflows/test-js.yml)
[![npm](https://img.shields.io/npm/v/@liteguard/liteguard-node)](https://www.npmjs.com/package/@liteguard/liteguard-node)

- Website: [liteguard.io](https://liteguard.io)
- Project Page: [https://github.com/liteguard/liteguard](https://github.com/liteguard/liteguard)
- Issues: [https://github.com/liteguard/liteguard/issues/new](https://github.com/liteguard/liteguard/issues/new)

Liteguard for Node.js.

## Installation

```bash
npm install @liteguard/liteguard-node
```

## Quick Start

```ts
import { LiteguardClient } from "@liteguard/liteguard-node";

const client = new LiteguardClient("pct-...", {
  environment: "env-production",
});
await client.start();

const scope = client.createScope({ userId: "user-123", plan: "pro" });

if (scope.isOpen("payments.checkout")) {
  // ...
}

await client.shutdown();
```

## Primary API

- `new LiteguardClient(projectClientToken, options)` creates a client.
- `await client.start()` fetches the initial bundle and starts refresh and flush workers.
- `client.createScope()` creates an immutable scope.
- `scope.isOpen()` evaluates locally.
- `scope.evaluate()` returns a `GuardDecision` with the full evaluation result.
- `scope.executeIfOpen()` and `scope.executeIfOpenAsync()` measure guarded work.
- `scope.startExecution()` creates an execution correlation handle.
- `scope.withProperties()` and `scope.withProtectedContext()` derive child scopes.
- `scope.getProperties()` returns the current property bag for transport.
- `client.flush()` flushes buffered telemetry.
- `client.shutdown()` flushes and stops background work.

## Convenience helpers

For server applications that want request-scoped context propagation:

- `client.runWithScope(scope, fn)` runs `fn` with `scope` as the active scope, propagated across `await` boundaries via `AsyncLocalStorage`.
- `client.getActiveScope()` returns the scope bound to the current request.
- `client.withProperties(properties, fn)` derives and activates a scope with additional properties.
- `client.withProtectedContext(protectedContext, fn)` derives and activates a protected scope.

## Notes

- Evaluation is local after the initial bundle fetch.
- Prefer explicit client and scope usage.
- Unadopted guards default open and emit no signals.
- The convenience helpers above also serve as infrastructure for auto-instrumentation of third-party dependencies. See the [Liteguard CLI](https://github.com/liteguard/liteguard/tree/main/cli) for build-time instrumentation.

## License

Apache 2.0 see [LICENSE](https://github.com/liteguard/liteguard/blob/main/LICENSE).
npm package: @litehouse/metrics
Description: Test/coverage/LOC metrics with a fully themeable report dashboard.
Author: George
Latest version: 0.1.5

# litehouse-metrics

Cross-platform CLI to generate test + coverage + cloc metrics and a static HTML report.

## Install (local)
```
npm i -D @gfdlr/litehouse-metrics
```

## Quick start
```
# Run tests + generate metrics JSON
npx @litehouse/metrics run

# Build report + serve at http://localhost:8000
npx @litehouse/metrics serve --open

# Dev mode: run metrics, serve, watch JSON, open browser once
npx @litehouse/metrics dev
```

## Commands
- `run` – runs tests with coverage, optional cloc, writes `metrics/metrics.json` and `metrics/history/metrics-<timestamp>.json`.
- `report` – rebuilds `metrics/report/index.html` from JSON.
- `serve` – rebuilds report and serves `metrics/report/` on port 8000.
- `watch` – watches JSON and rebuilds report on change.
- `dev` – `run` + `serve` + `watch` + open browser once.
- `presets` – list available presets.

## Options
Common options:
- `--cwd <path>` – project root (default: current working directory)
- `--config <path>` – path to `litehouse-metrics.config.json`
- `--preset <name>` – apply a preset (`next`, `node`)
- `--set <key=value>` – override config values (repeatable)
- `--port <number>` – server port (default: 8000)
- `--host <host>` – server host (default: `localhost`)
- `--open` / `--no-open` – open browser
- `--no-cloc` – skip cloc
- `--no-categories` – skip per-category coverage runs
- `--test-command <cmd>` – custom test command to run instead of Vitest
- `--test-summary <path>` – optional path to test summary JSON
- `--coverage-summary <path>` – path to coverage summary JSON

## Config file (optional)
Create `litehouse-metrics.config.json` in your project root to override defaults.
See the template in this repo: `litehouse-metrics.config.json`.

Presets:
- `next` (default)
- `node`

Themes:
- `minimal` (default)
- `neon-hud`
Themes can also change the report layout.
Themes live in `src/report-themes/` and are loaded by filename.
Layouts live in `src/report-layouts/` and are selected by the theme `layout` field.

Add a new theme by copying an existing JSON file in `src/report-themes/` and setting `layout` to `minimal` or `hud`.

Example theme override:
```
{
  "report": {
    "theme": "neon-hud"
  }
}
```

Example override without editing JSON:
```
npx @gfdlr/litehouse-metrics report --set report.charts.coverage.metric=branches
```

## Notes
- `cloc` is optional. If it’s not installed, LOC metrics are omitted.
- `vitest` must be available in the target project (local `node_modules/.bin` preferred).
- If you use `--test-command`, ensure it produces `coverage/coverage-summary.json`. Optionally write a test summary JSON and point to it with `--test-summary`.
- When `--test-command` is used, per-category coverage runs are skipped by default.