open-index/open-npm huggingface dataset:
npm package: @mockpiler/code-frame
Description: Code-frame generator used internally by MockpilerJS
Author: Camilo Rodríguez
Latest version: 0.2.0

# @mockpiler/code-frame

Code-frame generator used internally by MockpilerJS

## Usage

```js
import { scan } from '@mockpiler/lexer'
import { generateCodeFrame } from '@mockpiler/code-frame'

const input = `
  [
    (2) {
      name
      age
    }
  ]
`

const tokens = scan(input)
const tokenIndex = tokens.findIndex(token => token.value === 'age')

console.log(generateCodeFrame(tokens, tokenIndex))

/**
 * Output:
 *
 *    1|
 *    2|  [
 *    3|    (2) {
 *    4|      name
 *  > 5|      age
 *     |      ^^^
 *    6|    }
 *    7|  ]
 *    8|
 */
```
npm package: @mockpiler/context
Description: Context utils used internally by MockpilerJS
Author: Camilo Rodríguez
Latest version: 0.2.0

# @mockpiler/context

Context utilities used by MockpilerJS

## Helpers

```ts
import { helpers } from '@mockpiler/context'
// or import { helpers } from '@mockpiler/compiler'
```

### Array

#### `pick(array[, indexPicker])`

Generates a `context function` to randomly pick an item from the given `array`. You can optionally pass an `indexPicker` function to customize the selection.

**Usage:**

```ts
const context = {
  alphabet: helpers.pick(['a', 'b', 'c', 'd', 'e']),
  firstLetter: helpers.pick(['a', 'b', 'c', 'd', 'e'], () => 0)
}

context.alphabet() // Randomly get => 'b'
helpers.firstLetter() // Always get first item => 'a'
```

#### `tape(array)`

Generates a `context function` to sequentially pick an item from the given `array`. After reaching the last item, it will start picking again from the beginning.

**Usage:**

```ts
const context = {
  number: helpers.tape(['one', 'two'])
}

context.number() // => 'one'
context.number() // => 'two'
context.number() // => 'one' again
```

#### `index(array)`

Generates a `context function` to randomly get an index from the given `array`.

```ts
const context = {
  index: helpers.index(['one', 'two', 'three'])
}

context.index() // Randomly => 1
```

### Object

#### `lottery(object[, keys])`

Generates a `context function` to randomly pick a value from the given `object`. Optionally, you can pass an array of keys to pick from.

```ts
const user = {
  name: 'John Doe',
  age: 30
}

const context = {
  userValue: helpers.lottery(user),
  userName: helpers.lottery(user, ['name'])
}

context.userValue() // Randomly => 30
context.userName() // Always get => 'John Doe'
```

#### `path(keyPath)`

Generates a `context function` to access nested values by using a dot-delimited `keyPath`.

**Note:** It also handles accesses to `context function`s by calling them before accessing their return values.

```ts
const context = {
  image: () => ({
    urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'],
    size: {
      width: {
        px: 100
      },
      height: {
        px: 200
      }
    }
  }),
  firstImageUrl: helpers.path('image.urls.0'),
  imageWidth: helpers.path('image.size.width.px')
}

context.firstImageUrl() // => 'https://example.com/image1.jpg'
context.imageWidth() // => 100
```

### Miscellaneous

#### `cacheFirst(fn)`

Generates a `context function` to cache the first result from a given `context function`.

```ts
const randomNumber = helpers.pick([30, 50, 100, 40, 80])

const context = {
  number: helpers.cacheFirst(randomNumber)
}

context.number() // => 30
context.number() // subsequent calls gets the same value => 30
```
npm package: @mockpiler/lexer
Description: Lexical Analyzer for MockpilerJS
Author: Camilo Rodríguez
Latest version: 0.2.0

# @mockpiler/lexer

Lexical Analyzer for MockpilerJS

## Usage

```js
import { Lexer } from '@mockpiler/lexer'

const input = `
  [
    (2) {
      name
      age
    }
  ]
`

const lexer = new Lexer(input)
const tokens = lexer.scan()

console.log(tokens)

/**
 * Output:
 *
 *  [
 *    {
 *      type: 'array',
 *      value: '[',
 *      location: {
 *        start: {
 *          line: 2,
 *          column: 3
 *        },
 *        end: ...
 *      }
 *    },
 *    ...
 *  ]
 */
```
npm package: @mockpiler/type-compiler
Description: Types compilation for MockpilerJS
Author: Camilo Rodríguez
Latest version: 0.2.0

# @mockpiler/type-compiler

Types compilation for MockpilerJS

> Status: **Experimental**
>
> _Requires typescript >= 4.1.0_

## Usage

```ts
import type { CompileMock } from '@mockpiler/type-compiler'
import { mock } from '@mockpiler/compiler'

const input = `
  [
    (2) {
      name
      age
    }
  ]
`

const context = {
  name: 'John Doe',
  age: 33
}

const result = mock(input, context) as CompileMock<typeof input, typeof context>
```
npm package: @mockplusdev/plugin-typings
Description: Typings for the Mockplus-DT Plugin API
Author: Mockplus
Latest version: 1.0.3

# Usage

包含摹客DT 插件的 TS 类型约束

## 1. 安装

```
npm install @mockplusdev/plugin-typings -D
```
## 2. TS 配置

```
{
  "compilerOptions": {
    "target": "es6",
    "lib": ["es6"],
    "typeRoots": [
      "./node_modules/@types",
      "./node_modules/@mockplusdev"
    ]
  }
}

```
npm package: @mocks-rs/mocks
Description: Mock REST APIs from JSON with zero coding within seconds.
Author: codemountains
Latest version: 1.0.9

# mocks

Mock REST APIs from JSON with zero coding within seconds.

[![npm version](https://img.shields.io/npm/v/@mocks-rs/mocks.svg)](https://www.npmjs.com/package/@mocks-rs/mocks)
[![codecov](https://codecov.io/gh/mocks-rs/mocks/branch/main/graph/badge.svg?token=1WZ0YCZK9J)](https://codecov.io/gh/mocks-rs/mocks)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/mocks-rs/mocks)
[![License](https://img.shields.io/github/license/mocks-rs/mocks)](https://github.com/mocks-rs/mocks/blob/main/LICENSE)

**[Complete Documentation](https://mocks-rs.github.io/mocks)** - For detailed usage, advanced features, and examples.

## Install

```shell
npm install -g @mocks-rs/mocks
```

Or use without installing:

```shell
npx @mocks-rs/mocks --help
```

## Quick Start

### 1. Initialize a storage file

Create a JSON file using the `init` command:

```shell
npx @mocks-rs/mocks init storage.json
```

Or if installed globally:

```shell
mocks init storage.json
```

This creates a `storage.json` file with sample data. Use the `--empty` option to create an empty structure:

```shell
npx @mocks-rs/mocks init --empty storage.json
```

Or if installed globally:

```shell
mocks init --empty storage.json
```

### 2. Run a REST API server

Start the mock server using your JSON file:

```shell
npx @mocks-rs/mocks run storage.json
```

Or if installed globally:

```shell
mocks run storage.json
```

Example JSON structure:

```json
{
  "posts": [
    { "id": "01J7BAKH37HPG116ZRRFKHBDGB", "title": "first post", "views": 100 },
    { "id": "01J7BAKH37GE8B688PT4RC7TP4", "title": "second post", "views": 10 }
  ],
  "profile": { "id": "01J7BAQE1GMD78FN3J0FJCNS8T", "name": "mocks" }
}
```

### 3. Use your mock API

This automatically creates REST endpoints:

```shell
# List all posts
curl http://localhost:3000/posts

# Get a specific post
curl http://localhost:3000/posts/01J7BAKH37HPG116ZRRFKHBDGB

# Get profile (singleton resource)
curl http://localhost:3000/profile

# Create a new post
curl -X POST http://localhost:3000/posts \
  -H "Content-Type: application/json" \
  -d '{"title": "new post", "views": 0}'

# Health check
curl http://localhost:3000/_hc
```

## Available Endpoints

For each resource in your JSON file, mocks automatically creates:

- `GET /{resource}` - List all items
- `GET /{resource}/{id}` - Get specific item  
- `POST /{resource}` - Create new item
- `PUT /{resource}/{id}` - Replace entire item
- `PATCH /{resource}/{id}` - Partial update
- `DELETE /{resource}/{id}` - Delete item
- `GET /_hc` - Health check (returns 204)

## Documentation

For detailed information about advanced configuration, query parameters, filtering, and more features, visit the **[complete documentation](https://mocks-rs.github.io/mocks)**.

## Contributing

This project is open source. Visit the [GitHub repository](https://github.com/mocks-rs/mocks) to contribute or report issues.

## License

This project is licensed under the [MIT license](https://github.com/mocks-rs/mocks/blob/main/LICENSE).
npm package: @mocks-server/admin-api-paths
Description: Api paths of @mocks-server/plugin-admin-api
Author: Javier Brea
Latest version: 5.0.0

<p align="center"><a href="https://mocks-server.org" target="_blank" rel="noopener noreferrer"><img width="120" src="https://www.mocks-server.org/img/logo_120.png" alt="Mocks Server logo"></a></p>

<p align="center">
  <a href="https://github.com/mocks-server/main/actions?query=workflow%3Abuild+branch%3Amaster"><img src="https://github.com/mocks-server/main/workflows/build/badge.svg?branch=master" alt="Build Status"></a>
  <a href="https://codecov.io/gh/mocks-server/main"><img src="https://codecov.io/gh/mocks-server/main/branch/master/graph/badge.svg?token=2S8ZR55AJV" alt="Coverage"></a>
  <a href="https://sonarcloud.io/project/overview?id=mocks-server_main_admin-api-paths"><img src="https://sonarcloud.io/api/project_badges/measure?project=mocks-server_main_admin-api-paths&metric=alert_status" alt="Quality Gate"></a>
  <a href="https://www.npmjs.com/package/@mocks-server/admin-api-paths"><img src="https://img.shields.io/npm/dm/@mocks-server/admin-api-paths.svg" alt="Downloads"></a>
  <a href="https://renovatebot.com"><img src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg" alt="Renovate"></a>
  <a href="https://github.com/mocks-server/main/blob/master/packages/admin-api-paths/LICENSE"><img src="https://img.shields.io/npm/l/@mocks-server/admin-api-paths.svg" alt="License"></a>
</p>

---

# Api paths of the Mocks-Server Plugin Admin Api

Constants defining API paths of the [Mocks Server Plugin Admin API][plugin-admin-api-url]. They can be used to build plugin API clients.

## Installation

```bash
npm install --save @mocks-server/admin-api-paths
```

The UMD build is also available on unpkg. When UMD package is loaded, it creates a `pluginAdminApiPaths` global object containing all constants.

```html
<script src="https://unpkg.com/@mocks-server/admin-api-paths/dist/index.umd.js"></script>
```

## Usage

```js
import { BASE_PATH, CONFIG } from "@mocks-server/admin-api-paths";

console.log(BASE_PATH); // "/api"
console.log(CONFIG); // "/config"
```

## Contributing

Contributors are welcome.
Please read the [contributing guidelines](.github/CONTRIBUTING.md) and [code of conduct](.github/CODE_OF_CONDUCT.md).

[plugin-admin-api-url]: https://github.com/mocks-server/main/blob/master/packages/admin-api-client
npm package: @mocktailgpt/ts
Description: Contract-first TypeScript SDK and mock generator for OpenAI/ChatGPT APIs. Write your API in Swagger, auto-generate strict types, prod-ready calls, and plug-and-play mocks for development and tests.
Author: Antoine Pâques
Latest version: 0.0.3

# MocktailGPT

🚧 Work In Progress — v0.0.1 🚧

MocktailGPT is a contract-first TypeScript SDK and mock generator for OpenAI/ChatGPT APIs.

Describe your data contract in Swagger/OpenAPI, generate a fully typed SDK with mocks and prod-ready calls, all in one shot.
This package is currently in early development.
More features and documentation coming soon!

## Install

npm install @mocktailgpt/ts

## Usage

import { cheers } from '@mocktailgpt/ts'

console.log(cheers()) // 🍸 Welcome to MocktailGPT! (WIP release)

## License

MIT

Made with love and strictly typed cocktails.