open-index/open-npm huggingface dataset:
npm package: @purepack-common/cli-shared-utils
Description: 构建purepack-cli生态
Author: wonderfulMan
Latest version: 0.0.17
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@purepack-common/cli-shared-utils`

> TODO: description

## Usage

```
const cliSharedUtils = require('@purepack-common/cli-shared-utils');

// TODO: DEMONSTRATE API
```
npm package: @purepm/commit
Description: A tool to generate commit messages using AI.
Author: Pure PM
Latest version: 1.0.3


# @purepm/commit

## Description

@purepm/commit is a tool to generate commit messages using AI. It leverages the power of AI to create concise and informative commit messages based on your code changes.

## Installation

To install @purepm/commit, use npm:

```bash
npm install -g @purepm/commit
```

## Usage

### Setup

Before using @purepm/commit, you need to set it up by running:

```bash
mo-commit --setup
```

This will prompt you to configure the tool, including selecting your AI provider and entering your API token.

### Generate Commit Message

To generate a commit message, simply stage your changes and run:

```bash
mo-commit
```

You can also GPG-sign your commits by using the `-S` flag:

```bash
mo-commit -S
```

### Options

- `--setup`: Run the initial setup to configure the tool.
- `-S, --gpg-sign`: GPG-sign commits.

## Configuration

During setup, you will be prompted to provide the following information:
- AI provider (Currently supports Anthropic)
- API token
- Commit types to use

The configuration is saved in a file located at `~/.mo-commit-config.json`.

## License

This project is licensed under the MIT License.
npm package: @purepm/simplify
Description: A tool to simplify and streamline test files using Claude AI
Author: Your Name
Latest version: 1.0.13

# Test Simplification Script

This script is designed to simplify and streamline test files in a project by leveraging the Claude AI model. It searches for spec files, analyzes them, and generates simplified versions while maintaining their effectiveness.

## Features

- Recursively searches for spec files (`.spec.js`, `.spec.ts`, `.spec.vue`) in a given directory
- Identifies related files for each spec file
- Sends spec file content to Claude AI for analysis and simplification
- Generates a simplified version of each spec file
- Provides a progress bar during processing
- Creates a summary report of processed files

## Prerequisites

- Node.js
- NPM packages: `fs`, `path`, `axios`, `chalk`, `readline`
- Claude API key (set as an environment variable `CLAUDE_API_KEY`)


## Install

```
npm install -g @purepm/simplify
```

## Usage

1. Run the script:
   ```
   export CLAUDE_API_KEY=<your-claude-api-key> && simplify
   ```

2. Enter the directory path when prompted.

3. The script will process the spec files and display a progress bar.

4. After completion, a summary of processed files will be shown.

5. A JSON report will be generated in the specified directory.

## Functions

### `findSpecFilesAndRelated(dir, filesList = [])`

Recursively searches for spec files and their related files in the given directory.

### `sendToClaudeForReview(specContent, relatedContent)`

Sends the spec file content to Claude AI for analysis and simplification.

### `updateProgressBar(current, total)`

Updates and displays the progress bar during file processing.

### `main()`

The main function that orchestrates the entire process.

## Error Handling

- The script includes error handling for file reading, API calls, and JSON parsing.
- It implements a retry mechanism for failed API calls.

## Limitations

- For testing purposes, the script currently processes only the first 6 files.
- The Claude API has a token limit, which may affect the processing of very large spec files.

## Output

- Simplified spec files (overwriting the original files)
- A JSON report containing information about processed files and any errors encountered

## Note

Ensure you have the necessary permissions to read from and write to the specified directory. Always backup your files before running this script, as it modifies the original spec files.
npm package: @pureprofile/icons
Description: >
Author: potouridisio
Latest version: 1.0.23

# @pureprofile/icons

>

[![NPM](https://img.shields.io/npm/v/@pureprofile/icons.svg)](https://www.npmjs.com/package/@pureprofile/icons) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save @pureprofile/icons
```

## Usage

```tsx
import React, { Component } from 'react'

import { Settings as SettingsIcon } from '@pureprofile/icons'

class Example extends Component {
  render() {
    return <SettingsIcon fontSize='small' />
  }
}
```

## License

MIT
npm package: @pureprofile/pg-schema-dump
Description: utility to dump pg database schema into text comparable format
Latest version: 1.1.0

# pg-schema-dump

utility to dump pg database schema into text comparable format

## test coverage

| Statements | Branches | Functions | Lines |
| -----------|----------|-----------|-------|
| ![Statements](https://img.shields.io/badge/Coverage-59.72%25-red.svg "Make me better!") | ![Branches](https://img.shields.io/badge/Coverage-37.74%25-red.svg "Make me better!") | ![Functions](https://img.shields.io/badge/Coverage-54.43%25-red.svg "Make me better!") | ![Lines](https://img.shields.io/badge/Coverage-60.58%25-red.svg "Make me better!") |

## installation

```
npm install -g @pureprofile/pg-schema-dump
```

## usage

```
pg-schema-dump --url postgres://username:password@my-database.my-domain/database-name --out ./dump-my-db-here
```
npm package: @pureproxy/httptrace
Description: Mitm, intercepting proxy server designed with simplicity and extensibility in mind
Author: pdparchitect
Latest version: 1.2.1

[![Follow on Twitter](https://img.shields.io/twitter/follow/pdp.svg?logo=twitter)](https://twitter.com/pdp)
[![NPM](https://img.shields.io/npm/v/@pureproxy/httptrace.svg)](https://www.npmjs.com/package/@pureproxy/httptrace)

# HttpTrace

HttpTrace is a s simple tracing HTTP proxy. It is mean to be used as a demo of [mitmproxy](https://github.com/pureproxy/pureproxy) but it is an actual tool.

## How To Install

You need to install this library as a dependency like this:

```
$ npm install @pureproxy/httptrace
```

Install the httptrace binary like this:

```
$ npm install -g @pureproxy/httptrace
```

## How To Use

Simply invoke the tool from the command line:

```
$ httptrace
```

To define the default listening port, provide a `PORT` environment variable:

```
$ PORT=8888 httptrace
```

Set the proxy settings to `localhost:8888` or `localhost:8080` in default configuration. This is how you can do it for command line tools such as curl:

```
export http_proxy=http://localhost:8080
export https_proxy=http://localhost:8080
```

All requests and responses that pass through the proxy will be serialised to files in the current work directory.

HttpTrace will cluster. It will start sub-processes up-to the number of CPUs you have. This is prefered for optimal performance.
npm package: @pureproxy/pureproxy
Description: Pure, intercepting proxy server designed with simplicity and extensibility in mind
Author: pdparchitect
Latest version: 2.1.0

[![Follow on Twitter](https://img.shields.io/twitter/follow/pdp.svg?logo=twitter)](https://twitter.com/pdp)
[![NPM](https://img.shields.io/npm/v/@pureproxy/pureproxy.svg)](https://www.npmjs.com/package/@pureproxy/pureproxy)

# PureProxy

PureProxy is a simple but very flexible, streaming proxy server. The main purpose of this server is to be used as a base building block for other proxy servers, such as [mitmproxy](https://github.com/pureproxy/mitmproxy).

## How To Install

You need to install this library as a dependency like this:

```
$ npm install @pureproxy/pureproxy
```

## How To Use

The following code starts the proxy server as is:

```javascript
const PureProxy = require('@pureproxy/pureproxy')

const server = new PureProxy()

server.listen(8080)
```

Add additional features by extending the ProxyServer class:

```javascript
const stream = require('stream')
const PureProxy = require('@pureproxy/pureproxy')

const server = new class extends PureProxy {
  getClient(hostname, port, context) {
    // get the original client

    const client = super.getClient(hostname, port, context)

    // return a duplex stream (like sockets) to monitor all data in transit

    return new class extends stream.Duplex {
      constructor() {
        super()

        client.on('data', (data) => {
          // log incoming data

          console.log('<<<', data)

          this.push(data)
        })
      }

      _write(data, encoding, callback) {
        // log outgoing data

        console.log('>>>', data)

        client.write(data)

        callback()
      }

      _read() {}
    }
  }
}

server.listen(8080)
```

## FAQ

**Q: What is the point of this?** - Believe it or not, there is a lack of simple proxy servers for Node. I did look around and either all of them were way too complicated for their own good or they had a number of issues impossible to resolve without some serious time investment.

**Q: Why the weird API?** - The server is based around Node's streaming API. Sockets in Node are Duplex streams. Data is never cached, buffered or transformed as it passes the stream. In order to manipulate or observe the stream we simply need to create Duplex streams hence why the API may look a bit weird.

**Q: How fast is it?** - Have a look at the code. It is as fast as it practically possible. This module has no external dependencies and relies on Node's native bindings. You can easily use the Node's cluster API to scale it to as many CPU cores as you have.

**Q: How stable is it?** - This project is relatively young but so far there are no issues. It is unlikely to see any significant issues due to the size of the library. It is tiny.

**Q: Can I intercept TLS/SSL?** - You can intercept any traffic but it will be encrypted and compressed (i.e. raw). To intercept the traffic in clear text use mitmproxy which is based on this project.
npm package: @pureproxy/utils
Description: PureProxy utilities
Author: pdparchitect
Latest version: 2.1.0

[![Follow on Twitter](https://img.shields.io/twitter/follow/pdp.svg?logo=twitter)](https://twitter.com/pdp)
[![NPM](https://img.shields.io/npm/v/@pureproxy/utils.svg)](https://www.npmjs.com/package/@pureproxy/utils)

# Utils

Collection of utills for PureProxy.

## How To Install

You need to install this library as a dependency like this:

```
$ npm install @pureproxy/utils
```

## How To Use

Here is a practical example how to intercept requests and responses:

```javascript
const MitmProxy = require('@pureproxy/mitmproxy')
const Interceptor = require('@pureproxy/utils/lib/interceptor')

const { HTTPParser, methods } = process.binding('http_parser')

const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0
const kOnBody = HTTPParser.kOnBody | 0
const kOnMessageComplete = HTTPParser.kOnMessageComplete | 0

const server = new class extends MitmProxy {
  makeRequestParser() {
    const requestParser = new HTTPParser(HTTPParser.REQUEST)

    requestParser[kOnHeadersComplete] = (...args) => {
      console.log('>>>', ...args)
    }

    requestParser[kOnBody] = (buffer, start, len) => {
      buffer = buffer.slice(start, start + len)

      console.log('>>>', buffer.toString())
    }

    requestParser[kOnMessageComplete] = () => {
      console.log('>>> ~')
    }

    return requestParser
  }

  makeResponseParser() {
    const responseParser = new HTTPParser(HTTPParser.RESPONSE)

    responseParser[kOnHeadersComplete] = (...args) => {
      console.log('<<<', ...args)
    }

    responseParser[kOnBody] = (buffer, start, len) => {
      buffer = buffer.slice(start, start + len)

      console.log('<<<', buffer.toString())
    }

    responseParser[kOnMessageComplete] = () => {
      console.log('<<< ~')
    }

    return responseParser
  }

  wrapClientForObservableStreaming(client, { hostname, port, context }) {
    const requestParser = this.makeRequestParser()
    const responseParser = this.makeResponseParser()

    return new class extends Interceptor {
      constructor() {
        super(client)

        this.writeFore = this._writeFore
        this.writeBack = this._writeBack

        this.writeFore = this._sniffIt
      }

      _sniffIt(data) {
        this.writeFore = this._writeFore

        this.writeFore(data)
      }

      _writeFore(data) {
        requestParser.execute(data)

        super.writeFore(data)
      }

      _writeBack(data) {
        responseParser.execute(data)

        super.writeBack(data)
      }
    }
  }

  shouldIntercept(hostname, port, context) {
    return true
  }
}

server.listen(8080)
```
npm package: @purered/pr1digitalad-react-native
Description: React Native SDK that wraps an existing web experience inside a WebView.
Author: PureRed
Latest version: 0.2.1

# @purered/pr1digitalad-react-native

Small React Native SDK that wraps an existing web experience inside a `WebView`.

## Installation

```sh
yarn add @purered/pr1digitalad-react-native react-native-webview
```

Peer deps: `react >= 18`, `react-native >= 0.72`, `react-native-webview >= 13`.

## Usage

```tsx
import { DigitalAd } from '@purered/pr1digitalad-react-native';

export const Example = () => (
  <DigitalAd
    clientKey="YOUR_CLIENT_KEY"
    userId="user-123"
    locale="en-US"
    onLoaded={() => console.log('SDK loaded')}
    onEvent={(event) => console.log('SDK event', event)}
    onError={(err) => console.warn('SDK error', err)}
  />
);
```

### Props

- `clientKey` (string, required): your API key.
- `baseUrl` (string, optional): override the hosted page URL. Defaults to `DEFAULT_BASE_URL`.
- `userId` (string, optional): user identifier forwarded to the web experience.
- `locale` (string, optional): locale/region hint.
- `onEvent` (function, optional): receives events posted from the web page. JSON payloads with `{ type, payload }` are normalized; anything else is wrapped in `{ type: 'message', payload: raw }`.
- `onLoaded` (function, optional): called when the page finishes loading.
- `onError` (function, optional): called on load or HTTP errors.

### Building

```sh
yarn install
yarn build
```

Outputs go to `dist/` (run `yarn build` before publishing).