open-index/open-npm huggingface dataset:
npm package: @frosas/eslint-config
Description: ```sh $ npm i -D @frosas/eslint-config ```
Latest version: 10.3.3

# My usual ESLint config

## Setup

```sh
$ npm i -D @frosas/eslint-config
```

Copy the project-specific files and edit them as needed:

```sh
$ cp -a node_modules/@frosas/eslint-config/project-files/. .
```

Integrate it into the project development workflow. For example, in your `package.json`:

```json
{
  "scripts": {
    "lint": "eslint .",
    "test": "npm run lint && ..."
  }
}
```

## Contributing

- Make the changes
- Optionally, test the changes from another project (e.g., `npm install .../eslint-config`)
- Update CHANGELOG.md
- `npm version <major | minor | patch>`
- `npm publish [--tag next]`
npm package: @frost-beta/clip
Description: Compute embeddings of text/images with CLIP model
Author: zcbenz
Latest version: 1.3.1

# Clip

Node.js module for the [CLIP model](https://openai.com/index/clip/).

Powered by [node-mlx](https://github.com/frost-beta/node-mlx), a machine
learning framework for Node.js.

## APIs

```typescript
import { core as mx } from '@frost-beta/mlx';

export type ImageInputType = Buffer | ArrayBuffer | string;

export interface ProcessedImage {
    data: Buffer;
    info: sharp.OutputInfo;
}

export interface ClipInput {
    labels?: string[];
    images?: ProcessedImage[];
}

export interface ClipOutput {
    labelEmbeddings?: mx.array;
    imageEmbeddings?: mx.array;
}

export class Clip {
    constructor(modelDir: string);
    processImages(images: ImageInputType[]): Promise<ProcessedImage[]>;
    computeEmbeddings({ labels, images }: ClipInput): ClipOutput;
    /**
     * Short hands of computeEmbeddings to convert results to JavaScript numbers
     * and ensure the intermediate arrays are destroyed.
     */
    computeLabelEmbeddingsJs(labels: string[]): number[][];
    computeImageEmbeddingsJs(images: ProcessedImage[]): number[][];
    /**
     * Compute the cosine similarity between 2 embeddings.
     */
    static computeCosineSimilaritiy(a1: mx.array, a2: mx.array): mx.array;
    /**
     * Compute the cosine similarities between 2 arrays of embeddings.
     *
     * A tuple will be returned, with the first element being the cosine
     * similarity scores, and the second element being the indices sorted by
     * their scores from larger to smalller.
     */
    static computeCosineSimilarities(x1: mx.array | number[][], x2: mx.array | number[][]): [mx.array, mx.array];
}
```

## License

MIT
npm package: @frost-beta/huggingface
Description: A library and a CLI tool for accessing HuggingFace
Author: zcbenz
Latest version: 0.2.2

# huggingface

A library and a CLI tool for accessing HuggingFace.

## Usage

### CLI

```console
$ npm install -g @frost-beta/huggingface
$ huggingface
━━━ HuggingFace CLI ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  $ huggingface <command>

━━━ General commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  huggingface download [--to #0] [--revision #0] [--filter #0] [--hf] [--fix-tokenizer] [--silent] <repo>
    Download models or datasets from repository.

  huggingface login
    Set credentials for huggingface.

  huggingface whoami
    Show current user.

You can also print more details about any of these commands by calling them with
the `-h,--help` flag right after the command name.
```

### APIs

```ts
import * as hub from '@frost-beta/huggingface';

export interface DownloadOptions {
    revision?: string;
    showProgress?: boolean;
    filters?: string[];
    parallel?: number;
}
export declare function download(repo: string, dir: string, opts?: DownloadOptions): Promise<void>;

export declare class NotLoggedInError extends Error {}
export declare function whoami(): Promise<hub.WhoAmI>;

export declare function savePretrainedTokenizer(dir: string): void;
export declare function getCredentials(): hub.Credentials | undefined;
export declare function getAccessToken(): string | undefined;
export declare function getAccessTokenPath(): string;
```
npm package: @frost-beta/parquet-reader
Description: Read data from parquet files
Author: zcbenz
Latest version: 1.1.2

# parquet-reader

A simple library for reading parquet files.

## Install

```sh
npm install @frost-beta/parquet-reader
```

## Import

```js
import {ParquetReader, ParquetGroupReader} from '@frost-beta/parquet-reader';
```

## API

```ts
type IteratorOptions = {
    /**
     * Shuffle the data before iterating them.
     */
    shuffle?: boolean;
    /**
     * Optional compressors.
     */
    compressors?: Compressors;
    /**
     * How many rows to read in one chunk?
     */
    chunkSize?: number;
};

export declare class ParquetReader {
    /**
     * Create a new reader for `filePath`.
     */
    constructor(filePath: string);

    /**
     * Return raw metadata of the file.
     */
    getMetadata(): Promise<FileMetaData>;

    /**
     * Return total number of rows.
     */
    getRowsCount(): Promise<number>;

    /**
     * Return an generator which can be used to iterate the data.
     */
    getIterator(options?: IteratorOptions): Promise<AsyncGenerator<unknown[]>>;

    /**
     * Close the file.
     */
    close(): Promise<void>;
}

export declare class ParquetGroupReader {
    /**
     * Create a group reader for all the `filePaths`.
     */
    constructor(filePaths: string[]);

    /**
     * Return total number of rows of all files.
     */
    getRowsCount(): Promise<number>;

    /**
     * Return an generator which can be used to iterate the data.
     */
    getIterator(options?: IteratorOptions): Promise<AsyncGenerator<unknown[]>>;

    /**
     * Close all the files.
     */
    close(): Promise<void>;
}
```

## Example

```ts
import {compressors} from 'hyparquet-compressors'
import {ParquetGroupReader} from '@frost-beta/parquet-reader';

const reader = new ParquetGroupReader([
  'path/to/train-1.parquet',
  'path/to/train-2.parquet',
  'path/to/train-3.parquet',
]);
for await (const data of await reader.getIterator({shuffle: true, compressors})) {
  console.log(data);
}
await reader.close();
```
npm package: @frost-beta/sisi
Description: Semantic image search, locally without Internet
Author: zcbenz
Latest version: 0.2.2

# Semantic Image Search CLI (sisi)

CLI tool for semantic image search, locally without using third party APIs.

Powered by [node-mlx](https://github.com/frost-beta/node-mlx), a machine
learning framework for Node.js.

https://github.com/user-attachments/assets/66e6e437-c27b-48cf-80cc-a5a0c8c0bdfb

## Supported platforms

GPU support:

* Macs with Apple Silicon

CPU support:

* x64 Macs
* x64/arm64 Linux

(No support for Windows yet, but I might try to make MLX work on it in future)

For platforms without GPU support, the index command will be much slower, and
will take many hours indexing tens of thousands of images. The index is only
built for new and modified files, so once your have done the initial building,
updating index for new images will be much easier.

## Usage

Install:

```console
npm install -g @frost-beta/sisi
```

CLI:

```console
━━━ Semantic Image Search CLI - 0.0.1-dev ━━━━━━━━━━━━━━━━

  $ sisi <command>

━━━ General commands ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  sisi index <target>
    Build or update index for images under target directory.

  sisi list-index
    List the directories in the index.

  sisi remove-index <target>
    Remove index for all items under target directory.

  sisi search [--in #0] [--max #0] [--print] <query>
    Search the query string from indexed images.
```

## Examples

Build index for `~/Pictures/`:

```console
sisi index ~/Pictures/
```

Search pictures from all indexed images:

```console
sisi search 'cat jumping'
```

Search from the `~/Pictures/` directory:

```console
sisi search cat --in ~/Pictures/
```

Search images with image:

```console
sisi search https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg
```

It works with local files too:

```console
sisi search file:///Users/Your/Pictures/cat.jpg
```

## Under the hood

The index is built by computing the embeddings of images using the [CLIP
model](https://github.com/openai/CLIP), and then stored in a binary JSON file.

Searching the images is computing cosine similarities between the query string
and the indexed embeddings. There is no database involved here, everytime you do
a search the computation is done for all the embeddings stored, which is very
fast even when you have tens of thousands of pictures.

The JavaScript implementation of the CLIP model is in a separate module:
[frost-beta/clip](https://github.com/frost-beta/clip).

## License

MIT
npm package: @frost-utils/javascript
Description: A JavaScript utility library.
Author: Frost-ZX
Latest version: 2.1.3

# @frost-utils/javascript

## 函数列表

### 通用函数

- `common/compareString` - 使用 `localeCompare` 对比字符串
- `common/dataPagination` - 分页处理
- `common/dataToRanks` - 将数据拆分为行列
- `common/defaultValue` - 传入值为 `undefined` 或 `null` 时返回默认值
- `common/getCommonDateTime` - 获取 `yyyy-MM-dd HH:mm:ss` 格式的日期时间字符串
- `common/getObjectValue` - 通过路径获取对象属性值
- `common/getObjectsAttr` - 获取多个对象中的某个属性
- `common/isArray` - 检测参数是否为数组
- `common/isObject` - 检测参数是否为对象
- `common/mergeObject` - 合并对象属性
- `common/mergeObjects` - 对比多个对象的数据，合并为一个对象
- `common/rectCollisionCheck` - 检测两个矩形区域是否重叠
- `common/sleep` - 等待一段时间
- `common/toBroadcastAddress` - 将 IP 地址转换为广播地址

- `common/color/getHEXColor` - 获取随机的十六进制颜色值
- `common/color/getRGBColor` - 获取随机的 RGB 颜色值

### 浏览器专用

- `browser/isElement` - 检测参数是否为 `Element`
- `browser/isHTMLElement` - 检测参数是否为 `HTMLElement`
- `browser/observeElementVisible` - 检测元素显示隐藏
- `browser/rectCollisionCheck` - 检测两个矩形元素是否重叠

- `browser/data-url/blobToDataURL` - 转换二进制（Blob）为 Base64
- `browser/data-url/requestDataURL` - 请求获取文件，转换为 Base64
- `browser/data-url/selectFileDataURL` - 选择单个文件，获取 Base64
npm package: @frosted-ui/colors
Description: Frosted UI Colors
Latest version: 0.0.1-canary.133

# Frosted UI Colors

**A gorgeous, accessible color system used by Whop.**

---

## Documentation

For full documentation, visit [storybook.whop.dev](https://storybook.whop.dev/?path=/docs/guides-3-color--docs).

## Installation

`pnpm add @frosted-ui/colors`

## Acknowledgments

Frosted UI is heavily based on [Radix Colors](https://www.radix-ui.com/colors).
npm package: @frosted-ui/icons
Description: Frosted UI React Icons
Latest version: 0.0.1-canary.133

<h1 align="center">Frosted UI Icons</h1>

<p align="center">Icons used and designed by the <a href="https://whop.com/">Whop</a> team</p>

<h3 align="center">
  <a href="https://www.figma.com/design/Qz3t7Yi565N2u4l3Ha1w99">Figma file</a>
</h3>

<img width="1185" alt="Screenshot 2024-08-07 at 12 35 01" src="https://github.com/user-attachments/assets/bc38e63e-0d83-4ccc-8a7c-2f2dbf63c0fc">

## Documentation

All icons are available as individual React components. Each icon comes in `16`, `20`, `24` and `32` px size.

Install Frosted UI Icons from npm:

```bash
npm install @frosted-ui/icons
```

Import the icons into your React project:

```tsx
import { Shop16, Shop20 } from '@frosted-ui/icons';

function MyComponent() {
  return (
    <div>
      <Shop16 />
      <Shop20 />
    </div>
  );
}
```

## Configuring

### next.js

```js
// next.config.mjs
/** @type {import('next').NextConfig} */
const nextConfig = {
  modularizeImports: {
    '@frosted-ui/icons': {
      transform: '@frosted-ui/icons/{{member}}',
      skipDefaultConversion: true,
    },
  },
};

export default nextConfig;
```

## Contributing

Please follow our [contributing guidelines](./CONTRIBUTING.md).

## Acknowledgments

Frosted UI Icons library setup is based on [Radix Icons](https://github.com/radix-ui/icons).
npm package: @frosted/array-at
Description: Get the item at a specified index in an array, allowing for positive and negative integers
Author: 10x'ly Made / Frosted
Latest version: 1.0.1

# @frosted/array-at
Ponyfill for Array.prototype.at

## Installation
```bash
npm install @frosted/array-at
```

## Usage
```js
const at = require("@frosted/array-at")

console.log(at([1, 2, 3], 1)) // 2

console.log(at([20, 40, 60, 80], -2)) // 60

console.log(at("not array", 2)) // Error: Expects an array
```

Shimming Array.prototype.at:
```js
require("@frosted/array-at/shim")

console.log([1, 2, 3].at(1)) // 2
```

## Tests
Simply clone the repo and run npm test
npm package: @frosted/array-concat
Description: merge arrays together
Author: 10x'ly Made
Latest version: 1.0.0

# @frosted/array-at
Ponyfill for Array.prototype.concat

## Installation
```bash
npm install @frosted/array-concat
```

## Usage
```js
const concat = require("@frosted/array-concat")

console.log(concat([1, 2], [3])) // [1, 2, 3]
console.log(concat()) // []
console.log(concat([1])) // [1]
console.log(concat("not an array")) // Error: concat expects all arguments to be arrays
```

Shimming Array.prototype.at:
```js
require("@frosted/array-concat/shim")

console.log([1, 2, 3].concat([4, 5, 6])) // [1, 2, 3, 4, 5, 6]
```

## Tests
Simply clone the repo and run npm test
npm package: @frosted/array-reverse
Description: Reverse an array.
Author: 10x'ly Made
Latest version: 1.0.2

# @frosted/array-reverse
Ponyfill for Array.prototype.toReversed

## Installation
```bash
npm install @frosted/array-reverse
```

## Usage
```js
const reverse = require("@frosted/array-reverse")

console.log(reverse([1, 2, 3])) // [3, 2, 1]

console.log(reverse("not array")) // Error: Expects an array
```

Shimming Array.prototype.reverse:
```js
require("@frosted/array-reverse/shim")

console.log([1, 2, 3].toReversed()) // [3, 2, 1]
```

## Tests
Simply clone the repo and run npm test