open-index/open-npm huggingface dataset:
npm package: @nolanx/git2prompt
Description: Export a Git repository into an LLM-ready prompt for AI analysis.
Author: NolanX
Latest version: 1.0.2

# @nolanx/git2prompt

**Export a Git repository into an LLM-ready prompt for AI analysis.**

## Features

- Extracts tracked files from a Git repository
- Reads file contents while respecting `.gitignore` and `.git2promptignore`
- Generates a structured prompt for AI models like ChatGPT
- CLI support for quick usage

## Installation

You can install the package globally:

```sh
npm install -g @nolanx/git2prompt
```

Or use it directly with `npx`:

```sh
npx @nolanx/git2prompt /path/to/repo -o output.md
```

## Important Reminder

- The target repository must have Git installed and be initialized as a Git repository for this tool to work.

## Usage

### CLI Usage

```sh
npx @nolanx/git2prompt <repoPath> [options]
```

#### Options:

- `-o, --output <path>` Path to save the generated output file (Optional)
- `-V, --version` Show package version
- `-h, --help` Show help menu

#### Example:

```sh
npx @nolanx/git2prompt /path/to/repo -o output.md
```

This will generate a structured output of the Git repository and save it to `output.md`.

### Output Format Example

After running the command, the output file will contain a structured prompt like this:

```
## Repository Details:
- Repository Path: /path/to/repo
- Tracked Files:
  - index.js
  - app.ts
  - utils/helpers.js

## File Contents:

### File: index.js
console.log("Hello, world!");

### File: app.ts
export function greet(name: string) {
  return `Hello, ${name}`;
}

### File: utils/helpers.js
module.exports = function add(a, b) {
  return a + b;
};

## Instruction for ChatGPT:
Analyze the above repository, suggest improvements, refactor code, or help with specific tasks like fixing bugs, adding features, or understanding the code structure.
```

### Programmatic Usage

You can use it in a Node.js project:

```ts
import { exportGitToPrompt } from "@nolanx/git2prompt";

(async () => {
  const output = await exportGitToPrompt("/path/to/repo");
  console.log(output);
})();
```

## License

MIT License
npm package: @nolawnchairs/object-key-case
Description: Utility for converting object keys to camelCase or snake_case
Author: Michael Wieczorek
Latest version: 0.0.2


# Object Key Case

Utilty package that converts all keys in an object to/from `camelCase` or `snake_case`.

## Motivation

It's an unwritten rule that all keys in a JavaScript object should be `camelCase`. However, there are times when you need to convert to/from `snake_case` for use with a database or API. This package provides a simple way to convert between the two.

## Installation

```bash
npm install @nolawnchairs/object-key-case
```

## Usage

The functional approach is to use the `convertKeyCase` function.

```typescript
import { convertKeyCase } from '@nolawnchairs/object-key-case'

// An API request returns an object with snake_case keys
const data = await fetch('https://example.com/api')
    .then((res) => res.json())
    .then((data) => convertKeyCase(data, 'camel'))
```

There is also the object-oriented approach using the `KeyConversionContext` class. This class when instantiated will retain state, which caches the conversion result for each key. This is beneficial when processing an array of multiple objects of the same shape, or many requests over time, as the regex-based conversion only needs to be computed once per key.

```typescript
import { KeyConversionContext } from '@nolawnchairs/object-key-case'

// Create a context for converting to camelCase
// All key conversions will be cached within this context
const context = new KeyConversionContext('camel')

// An API request returns an object with snake_case keys
const data = await fetch('https://example.com/api')
    .then((res) => res.json())
    .then((data) => context.convert(data))
```

Both `convertKeyCase` and `KeyConversionContext#convert` either accept an object with key value pairs or an array of the same. An error will be thrown if any other data type is provided. For convenience, all errors thrown by this package are instances of `ConversionException`. This is simply a subclass of `Error` that can be matched in a catch block using `instanceof`.

```typescript
import { convertKeyCase, KeyConversionException } from '@nolawnchairs/object-key-case'

try {
    convertKeyCase('not an object', 'camel')
} catch (e) {
    if (e instanceof KeyConversionException) {
        // Handle error
    }
}
```

The value arguments for `convertKeyCase` and `KeyConversionContext#convert` accept an `unknown` type, and an optional generic type `T` and will return `T | Array<T>`. The generic is applied to the result of the operation. If no type argument is provided, the return type will be `unknown | Array<unknown>`.

```typescript
import { convertKeyCase } from '@nolawnchairs/object-key-case'

interface User {
    id: number
    firstName: string
    lastName: string
}

const data = await fetch('https://example.com/api')
    .then((res) => res.json())
    .then((data) => convertKeyCase<User>(data, 'camel'))
    // data is now of type User or Array<User>
```

Note that no data validation is performed. If the input data is not of the expected shape, the result will be unpredictable.