open-index/open-npm huggingface dataset:
npm package: @mchco/randomid-generator
Description: Link : https://www.npmjs.com/package/@mchco/randomid-generator ########################################################
Latest version: 1.0.2

Link : https://www.npmjs.com/package/@mchco/randomid-generator
########################################################

This package generates a random string of 10 characters

########################################################

You can use it to generate a password or unique ID

########################################################
npm package: @mchen-lab/string-to-zod
Description: Convert string-schema syntax to Zod schemas for LLM structured output
Author: mchen-lab
Latest version: 0.1.0

# @mchen-lab/string-to-zod

Convert string-schema syntax to Zod schemas for LLM structured output.

## Installation

```bash
npm install @mchen-lab/string-to-zod
```

## Usage

```typescript
import { stringToZodSchema } from '@mchen-lab/string-to-zod';

// Basic types
const userSchema = stringToZodSchema("{name:str, age:int, active:bool}");

// Optional fields
const profileSchema = stringToZodSchema("{bio:string?, website:url?}");

// Constraints
const productSchema = stringToZodSchema("{name:string(min=1, max=100), price:number(min=0)}");

// Arrays
const tagsSchema = stringToZodSchema("{tags:[string]}");

// Nested objects
const complexSchema = stringToZodSchema("{user:{name:str}, items:[{id:int, qty:int}]}");

// Enums
const statusSchema = stringToZodSchema("{status:enum(pending, active, completed)}");

// Defaults and descriptions
const configSchema = stringToZodSchema("{enabled:bool=true | Feature flag, count:int=0}");
```

## String Schema Syntax

| Type | Example | Description |
|------|---------|-------------|
| `str` / `string` | `{name:str}` | String field |
| `int` / `integer` | `{age:int}` | Integer number |
| `num` / `number` / `float` | `{price:num}` | Float number |
| `bool` / `boolean` | `{active:bool}` | Boolean |
| `url` | `{website:url}` | URL string |
| `email` | `{contact:email}` | Email string |
| `date` | `{created:date}` | Date string |
| `[type]` | `{tags:[string]}` | Array of type |
| `{...}` | `{user:{name:str}}` | Nested object |
| `enum(...)` | `{status:enum(a, b)}` | Enum values |
| `?` suffix | `{bio:str?}` | Optional field |
| `=value` | `{count:int=0}` | Default value |
| `\| desc` | `{name:str \| User name}` | Field description |

## API

### `stringToZodSchema(schemaStr: string): ZodTypeAny`

Converts a string schema to a Zod schema.

### `parseSchema(schemaStr: string): ParsedSchema`

Parses a string schema into an intermediate AST (useful for debugging).

## License

MIT
npm package: @mchirag2002/utils
Description: A collection of utility functions by Chirag
Author: Chirag Mathur
Latest version: 1.0.1

# @mchirag2002/utils

A lightweight collection of reusable TypeScript utility functions for everyday web development — including helpers for math, strings, objects, and API fetch wrappers.

---

## 🚀 Installation

```bash
npm install @mchirag2002/utils
````

or with yarn:

```bash
yarn add @mchirag2002/utils
```

---

## 📦 Usage

### Import the utilities

```ts
import { sum, capitalize, deepClone, fetchJSON } from "@mchirag2002/utils";
```

### ✨ Examples

#### 🧮 Math Utils

```ts
sum(10, 20); // 30
average([10, 20, 30]); // 20
randomInt(1, 10); // e.g. 7
```

#### 🔤 String Utils

```ts
capitalize("hello world"); // "Hello world"
slugify("Hello World from Chirag!"); // "hello-world-from-chirag"
```

#### 🧠 Object Utils

```ts
const obj = { a: 1, b: { c: 2 } };
const clone = deepClone(obj);
clone.b.c = 10;

console.log(obj.b.c); // 2 (original object not affected)
```

#### 🌐 Fetch Utils

```ts
const data = await fetchJSON("https://jsonplaceholder.typicode.com/todos/1");
console.log(data);
```

---

## 🧱 Utilities Included

| Category   | Function                   | Description                   |
| ---------- | -------------------------- | ----------------------------- |
| **Math**   | `sum(a, b)`                | Adds two numbers              |
|            | `average(numbers[])`       | Calculates average            |
|            | `randomInt(min, max)`      | Returns random integer        |
| **String** | `capitalize(str)`          | Capitalizes first letter      |
|            | `slugify(str)`             | Converts to URL-friendly slug |
| **Object** | `deepClone(obj)`           | Creates deep copy             |
|            | `mergeObjects(obj1, obj2)` | Deep merges two objects       |
| **Fetch**  | `fetchJSON(url, options?)` | Fetch wrapper returning JSON  |

---

## 🛠️ Development

Clone the repo and build locally:

```bash
git clone https://github.com/mchirag2002/utils.git
cd utils
npm install
npm run build
```

---

## 🧩 Project Structure

```
src/
 ┣ math.ts
 ┣ string.ts
 ┣ object.ts
 ┣ fetch.ts
 ┗ index.ts
```

---

## 📄 License

MIT © [Chirag Mathur](https://github.com/mchirag2002)

```