open-index/open-npm huggingface dataset:
npm package: @sgvolpe/api-mock-from-curl
Description: Generates a mock server from a curl command
Author: sgvolpe1
Latest version: 1.0.0

# api-mock-from-curl

Paste a **curl** command → get a **mock server** that responds to that request. No OpenAPI spec required.

## Usage

```bash
npx api-mock-from-curl "curl https://api.example.com/users"
```

```bash
# Custom port
npx api-mock-from-curl "curl https://api.com/users" -p 4000
```

## API

```ts
import { parseCurl, createMockServer } from 'api-mock-from-curl';

const parsed = parseCurl('curl https://api.com/users');
createMockServer(parsed, 3000);
```

---

## 🔄 Difference from other packages

| Package | Input | Our difference |
|---------|-------|----------------|
| **openapi-mock-express-middleware** | OpenAPI/Swagger spec file | **api-mock-from-curl** starts from a **curl command**. No spec needed. Copy a curl from DevTools → mock server. |
| **open-api-mocker** | OpenAPI 3.0 spec | Same — requires spec. We need **zero setup**: just the curl. |
| **openapi-mock** | Swagger/OpenAPI spec | Same. |
| **curlconverter** | curl → code (fetch, axios, etc.) | curlconverter generates **code**. We generate a **running mock server** that responds to that request. |

**TL;DR:** Other tools = OpenAPI spec → mock. **api-mock-from-curl** = curl → mock. Ideal when you have a real request you want to mock but no spec file.
npm package: @sgvolpe/api-response-normalizer
Description: Transform, normalize and map generic REST API responses (not JSON:API)
Author: sgvolpe
Latest version: 1.0.0

# api-response-normalizer

Utilities for transforming, normalizing and mapping **generic REST API responses**. Works with any JSON structure — not limited to JSON:API format.

## Installation

```bash
npm install @sgvolpe/api-response-normalizer
```

## Usage

```ts
import { extractData, toArray, mapResponse, pickFromResponse } from '@sgvolpe/api-response-normalizer';

// Generic REST response
const response = {
  data: [{ id: 1, name: 'Juan', email: 'juan@example.com' }],
  meta: { total: 1 }
};

// Extract the data array
const users = extractData(response); // [{ id: 1, name: 'Juan', ... }]

// Map to different shape
const names = mapResponse(response, u => u.name); // ['Juan']

// Pick specific fields
const minimal = pickFromResponse(response, ['id', 'name']); // [{ id: 1, name: 'Juan' }]
```

## API

- **`extractData(response, path?)`** — Extract from `data`, `result`, `items` or custom path
- **`toArray(response, options?)`** — Normalize to array, with optional flatten
- **`mapResponse(response, mapFn, dataPath?)`** — Map items (lodash-style)
- **`pickFromResponse(response, keys, dataPath?)`** — Pick specific keys from each item
- **`flattenResponse(response)`** — Flatten nested structure

---

## 🔄 Difference from other packages

| Package | Scope | Our difference |
|---------|-------|----------------|
| **json-api-normalizer** / **jsonapi-normalizer** | Only [JSON:API](https://jsonapi.org/) format (specific spec with `data`, `attributes`, `relationships`, `included`) | **api-response-normalizer** works with **any REST API** — typical responses like `{ data: [...] }`, `{ users: [...] }`, nested objects. Most APIs don't use JSON:API. |
| **normalizr** (archived) | Redux-focused, schema-based normalization | No Redux dependency. Lightweight utilities for **mapping, picking, extracting** — more like "lodash for API responses". |
| **@data-client/normalizr** | Fork of normalizr, Redux/state management | Same as above — we're framework-agnostic and focus on transform utilities, not state normalization. |

**TL;DR:** Use `json-api-normalizer` if your API follows JSON:API spec. Use `api-response-normalizer` for **generic REST APIs** with arbitrary JSON structures.
npm package: @sgvolpe/cli-to-api
Description: Expose any CLI command as REST API endpoints
Author: sgvolpe
Latest version: 1.0.0

# cli-to-api

Expose **any CLI command** as REST API endpoints. Wrap `ffmpeg`, `imagemagick`, custom scripts, or any terminal tool and call them via HTTP.

## Installation

```bash
npm install @sgvolpe/cli-to-api
```

## Usage

Create `cli-to-api.config.js`:

```js
module.exports = {
  commands: {
    echo: {
      command: 'echo',
      argsFromRequest: (req) => req.body?.args || []
    },
    date: { command: 'date', args: [] }
  }
};
```

Run:

```bash
npx cli-to-api
# POST http://localhost:3000/echo  { "args": ["hello"] }
# POST http://localhost:3000/date
```

## Programmatic API

```ts
import { createCliApi, runCli, startCliApi } from '@sgvolpe/cli-to-api';

const app = createCliApi({
  port: 3000,
  commands: {
    convert: {
      command: 'ffmpeg',
      argsFromRequest: (req) => ['-i', req.body.input, '-o', req.body.output]
    }
  }
});

app.listen(3000);
```

## API

- **`runCli(command, args)`** — Execute CLI, returns `{ stdout, stderr, code }`
- **`createCliApi(options)`** — Express app with POST endpoints
- **`startCliApi(options)`** — Create and start server

---

## 🔄 Difference from other packages

| Package | What it does | Our difference |
|---------|--------------|----------------|
| **wrapi** | Wraps **REST API endpoints** as callable functions (API → functions) | **cli-to-api** does the **reverse**: CLI commands → REST API. You have a CLI, you want to expose it over HTTP. |
| **@a0dotrun/expose** | Exposes "tools" (Zod-defined) as HTTP API — for AI/LLM tool use | **cli-to-api** wraps **arbitrary CLI commands** (ffmpeg, imagemagick, your scripts). No Zod, no AI — just subprocess → HTTP. |
| **express** + manual `child_process` | You write the glue yourself | **cli-to-api** = config-driven. Define command + arg mapping, get endpoints. |

**TL;DR:** wrapi = REST → functions. **cli-to-api** = CLI → REST. Expose any terminal command as an API without writing boilerplate.
npm package: @sgvolpe/curl-to-typescript-client
Description: Converts curl commands into TypeScript SDK with Axios client
Author: sgvolpe1
Latest version: 1.0.0

# curl-to-typescript-client

One **curl** → full **TypeScript SDK**: typed client, Axios methods, ready to use. Not just a snippet — a complete client.

## Usage

```bash
npx curl-to-typescript-client "curl https://api.example.com/users -H 'Authorization: Bearer token'"
```

```bash
# With output file
npx curl-to-typescript-client "curl https://api.com/users" -o api-client.ts
```

## API

```ts
import { parseCurl, generateFullSDK } from 'curl-to-typescript-client';

const parsed = parseCurl('curl https://api.com/users');
const sdk = generateFullSDK(parsed);
```

---

## 🔄 Difference from other packages

| Package | Output | Our difference |
|---------|--------|----------------|
| **curlconverter** | Code snippet in 30+ languages (fetch, axios, Python, etc.) — one request at a time | **curl-to-typescript-client** generates a **full SDK**: client class, methods per endpoint, TypeScript types. Not just a one-off snippet — a reusable client. |
| **openapi-typescript-codegen** | TypeScript client from **OpenAPI spec** | We start from **curl**, not a spec. No spec file needed. Copy curl from DevTools → SDK. |
| **@hey-api/openapi-ts** | OpenAPI → TypeScript | Same — requires OpenAPI. We work with curl only. |

**TL;DR:** curlconverter = curl → snippet. **curl-to-typescript-client** = curl → **complete SDK** (types + methods + client). openapi-* = spec → SDK. We = curl → SDK.
npm package: @sgvolpe/env-checker
Description: Checks differences between .env, .env.example, .env.production
Author: sgvolpe
Latest version: 1.0.0

# env-checker

Checks differences between environment variable files.

## Usage

```bash
npx env-checker
# or from a specific directory
npx env-checker ./my-project
```

## API

```js
const { checkEnv, formatReport } = require('env-checker');

const results = checkEnv({ cwd: process.cwd() });
console.log(formatReport(results));
```

## Files it checks

- `.env`
- `.env.example`
- `.env.local`
- `.env.production`
npm package: @sgvolpe/env-diff-checker
Description: Compare .env files and show value differences (not just presence)
Author: sgvolpe
Latest version: 1.0.0

# env-diff-checker

Compare `.env` files and show **value differences** — not just which variables exist, but how their values differ between files.

## Installation

```bash
npm install @sgvolpe/env-diff-checker
```

## Usage

```bash
# Compare .env, .env.example, .env.production
npx env-diff

# Compare two specific files
npx env-diff .env .env.production
```

## API

```ts
import { diffEnvFiles, diffMultipleEnvFiles } from '@sgvolpe/env-diff-checker';

// Two files
const result = diffEnvFiles('.env', '.env.example');
// result.onlyInA, result.onlyInB, result.differentValues (key, valueA, valueB)

// Multiple files
const results = diffMultipleEnvFiles(['.env', '.env.example', '.env.production']);
```

---

## 🔄 Difference from other packages

| Package | What it does | Our difference |
|---------|--------------|----------------|
| **env-checker** / **@sgvolpe/env-checker** | Checks which variables are **missing** or **extra** (presence only). Compares against .env.example. | **env-diff-checker** shows **value differences**. Same variable in both files but different values? We show it. `API_URL` = "http://localhost" vs "https://api.com". |
| **znv, @zodyac/zod-env, validate-env-vars** | **Validate** env vars against a schema (types, required, etc.) | **env-diff-checker** does **comparison** between files. No validation — pure diff. |
| **dotenv** | Loads .env into process.env | We don't load — we compare. |

**TL;DR:** env-checker = "do you have all the vars?". **env-diff-checker** = "do your .env files have the same values?". Catches config drift between dev/staging/prod.
npm package: @sgvolpe/inquirer-presets
Description: Ready-to-use preset flows for inquirer (project setup, API config, CRUD wizard)
Author: sgvolpe
Latest version: 1.0.0

# inquirer-presets

Ready-to-use preset flows for [inquirer](https://www.npmjs.com/package/inquirer). No need to manually wire questions — use pre-built wizards for common scenarios.

## Installation

```bash
npm install inquirer @sgvolpe/inquirer-presets
```

## Usage

```ts
import inquirer from 'inquirer';
import { projectSetupPreset, apiConfigPreset, crudPreset } from '@sgvolpe/inquirer-presets';

// Project setup
const project = await inquirer.prompt(projectSetupPreset());

// API config
const api = await inquirer.prompt(apiConfigPreset());

// CRUD resource
const crud = await inquirer.prompt(crudPreset());
```

## Available Presets

| Preset | Purpose |
|--------|---------|
| `projectSetupPreset()` | Project name, package manager, language |
| `apiConfigPreset()` | API base URL, auth type |
| `crudPreset()` | Resource name, fields, timestamps |
| `databasePreset()` | Database type, host, port |

## API

```ts
import {
  projectSetupPreset,
  apiConfigPreset,
  crudPreset,
  databasePreset
} from '@sgvolpe/inquirer-presets';

// Each returns QuestionCollection for inquirer.prompt()
const questions = projectSetupPreset();
const answers = await inquirer.prompt(questions);
```

---

## 🔄 Difference from other packages

| Package / Approach | What it does | Our difference |
|--------------------|--------------|----------------|
| **inquirer** | Low-level: you define each question manually with `when`, `choices`, etc. | **inquirer-presets** provides **ready-made question flows**. You call `projectSetupPreset()` instead of writing 5+ question objects. |
| **@inquirer/prompts** | Modern inquirer rewrite, same low-level API | Same — no preset flows. We complement it with pre-built wizards. |
| **Manual inquirer usage** | Stack Overflow examples, copy-paste 20 lines per flow | **inquirer-presets** = 1 line. Extensible — add your own presets. |

**TL;DR:** inquirer gives you the engine. **inquirer-presets** gives you the batteries — common flows (project setup, API config, CRUD) out of the box.
npm package: @sgvolpe/sql-explainer
Description: Explain SQL queries in plain language - npm/CLI package (no SaaS)
Author: sgvolpe
Latest version: 1.0.0

# sql-explainer

Explain SQL queries in plain language. **npm/CLI package** — runs locally, no SaaS, no API keys.

## Installation

```bash
npm install @sgvolpe/sql-explainer
```

## Usage

```bash
# From string
npx sql-explainer "SELECT * FROM users WHERE active = 1"

# From file
npx sql-explainer query.sql
```

## API

```ts
import { explainSql } from '@sgvolpe/sql-explainer';

const result = explainSql('SELECT u.name, o.total FROM users u JOIN orders o ON u.id = o.user_id WHERE o.total > 100');
// result.summary: "This query retrieves data from the database."
// result.steps: ["It reads from: users, orders", "It joins multiple tables together.", ...]
// result.tables: ["users", "orders"]
// result.operations: ["join", "filter"]
```

---

## 🔄 Difference from other packages

| Tool | Format | Our difference |
|------|--------|----------------|
| **SQLAI.ai, Text2SQL.ai, ChartDB** | Online SaaS — paste SQL in a web form | **sql-explainer** is an **npm package** and **CLI**. Use it in scripts, CI, or programmatically. No signup, no API keys. |
| **DBeaver AI Explain, Oracle AI Explain** | Built into database tools | **sql-explainer** is **standalone**. Works with any SQL file or string. Integrate into your own tools. |
| **llm-to-sql, ormGPT** | Natural language → SQL (opposite direction) | **sql-explainer** does **SQL → natural language**. You have a query, you want to understand it. |
| **Rule-based vs LLM** | — | Current version uses **rule-based parsing** (no LLM). Works offline, fast, no cost. Can be extended with optional LLM for deeper explanations. |

**TL;DR:** Online tools = paste in browser. **sql-explainer** = `npx sql-explainer query.sql` in your terminal or `import { explainSql }` in your code. Fully local.
npm package: @sgwilym/isomorphic-streams
Description: Isomorphic WHATWG Streams API package for browser and Node.js
Author: Konstantin Möllers
Latest version: 1.0.4

# isomorphic-streams

[![Node.js CI](https://github.com/ksm2/isomorphic-streams/actions/workflows/node.js.yml/badge.svg)](https://github.com/ksm2/isomorphic-streams/actions/workflows/node.js.yml)
[![NPM version](https://img.shields.io/npm/v/isomorphic-streams)](https://www.npmjs.com/package/isomorphic-streams)
[![license](https://img.shields.io/github/license/ksm2/isomorphic-streams)](https://opensource.org/licenses/MIT)
[![TypeScript types](https://img.shields.io/npm/types/isomorphic-streams)](https://github.com/ksm2/isomorphic-streams/blob/main/index.d.ts)

> Isomorphic [WHATWG Streams API] package for browser and Node.js

This package has

- **zero dependencies**
- provides **TypeScript typings**
- supports `ReadableStream`, `WritableStream` and `TransformStream`

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)

## Install

Use either

    yarn add isomorphic-streams

or

    npm install isomorphic-streams

## Usage

**In the browser:** Instead of using the global `ReadbaleStream` or `window.ReadableStream`, import from this package instead.

**In Node.js:** Instead of importing `node:stream/web` or requiring `stream/web`, import from this package instead.

The following code will work in both Node.js and the browser:

```js
import { ReadableStream } from "isomorphic-streams";

const SECOND = 1000;

const stream = new ReadableStream({
  start(controller) {
    setInterval(() => {
      controller.enqueue(Date.now());
    }, SECOND);
  },
});

for await (const value of stream) {
  console.log(value);
}
```

[More examples][examples]

## Contributing

This project is open to feedback and contributions, please open an issue.

`isomorphic-streams` follows the [Contributor Covenant] Code of Conduct.

## License

MIT © 2021 Konstantin Möllers, see [LICENSE].

[whatwg streams api]: https://streams.spec.whatwg.org/
[license]: https://github.com/ksm2/isomorphic-streams/blob/main/LICENSE
[contributor covenant]: https://github.com/ksm2/isomorphic-streams/blob/main/CODE_OF_CONDUCT.md
[examples]: https://github.com/ksm2/isomorphic-streams/tree/main/examples