open-index/open-npm huggingface dataset:
npm package: @kortexa-ai/react-shadertoy
Description: React component for Shadertoy shaders
Author: Franci Penov
Latest version: 0.2.2

## Description

React-shadertoy is a lightweight component for using Shadertoy shaders in React and React Native applications. It provides two components - a `Shadertoy` component for embedding Shadertoy shaders on a plane in your own scene, and a `ShadertoyCanvas` component for showing Shadertoy shaders in their own canvas in your DOM tree.

## Demo

[Live Demo](https://kortexa-ai.github.io/react-shadertoy/) - Interactive examples showcasing the Shadertoy component

## Installation

```bash
npm install @kortexa-ai/react-shadertoy
```

## Usage

```tsx
import { Shadertoy } from "@kortexa-ai/react-shadertoy";
```

### Shadertoy

The `Shadertoy` component is a React component that embeds a Shadertoy shader in a plane in your own scene. It takes a `fs` prop, which is the shader code to be embedded. You can also pass `vs` prop for an optional vertex shader.

```tsx
import { Shadertoy } from "@kortexa-ai/react-shadertoy";

function App() {
    return (
        <Canvas>
            <Shadertoy fs={SHADER_CODE} />
        </Canvas>
    );
}
```

### ShadertoyCanvas

\*\* NOTE: This component is currently disabled.

The `ShadertoyCanvas` component is a React component that embeds a Shadertoy shader in a canvas in your DOM tree. It takes a `fs` prop, which is the shader code to be embedded.

```tsx
import { ShadertoyCanvas } from "@kortexa-ai/react-shadertoy";

function App() {
    return <ShadertoyCanvas fs={SHADER_CODE} />;
}
```

## Develop

React-shadertoy supports both React 18, and React 19, as well as Expo v52 / React Native v0.76. because some of these have conflicting dependencies, you have to npm install with `--legacy-peer-deps`.

```bash
npm install --legacy-peer-deps
npm run build
```

## Troubleshooting

Don't forget to deduplicate Three.js and @react-three/fiber in your vite config:

```ts
resolve: {
    dedupe: [
        "react",
        "react-dom",
        "three",
        "@react-three/fiber",
        "@kortexa-ai/react-shadertoy"
    ]
}
```

---

© 2025 kortexa.ai
npm package: @kortin/enum
Description: A enum utility for typescript
Author: kortin.zhou
Latest version: 0.0.1-beta.1

# Enum [![npm](https://img.shields.io/npm/v/enum.svg)](https://npmjs.com/package/enum) [![npm](https://img.shields.io/npm/dm/enum.svg)](https://npmjs.com/package/enum)

<!-- [![GitHub stars](https://img.shields.io/github/stars/antfu-90/enum.svg?style=social&label=Stars)](https://github.com/antfu-90/enum) -->

集中式管理你的枚举声明

## 📦 Installation

```bash
npm i @kortin/enum --save
```

## 🍽️ Usage

1. 创建枚举

> 注意：为了获得更好的 TS 类型推导，枚举值类型需要使用 `as const` 声明

```ts
import Enum from '@kortin/enum';

const JobRunStateEnum = Enum.create([
  { key: 'Pending', label: '待构建', value: '0', color: 'red' },
  { key: 'Queuing', label: '排队中', value: 1, color: 'green' },
  { key: 'Building', label: '构建中', value: 2, color: 'red' },
  { key: 'Succeed', label: '构建完成', value: 3, color: 'green' },
  { key: 'Failed', label: '构建失败', value: 4, color: 'red' },
  { key: 'Canceled', label: '被取消', value: 5, color: 'red' },
  { key: 'Published', label: '已发布', value: 6, color: 'green' },
] as const);
```

其中 key、label、value 是枚举值必须有的属性，其余属性都可以根据业务需求自行添加

- `key`: 枚举值唯一标识，与 TypeScript 中声明 enum 左侧的 key 意义相同
- `label`: 枚举值展示的名称
- `value`: 枚举值对应的实际值

如果你已经有了类似格式的枚举数据，可以直接使用 `toEnum` 方法创建枚举

```ts
const jobRunState = [
  { key: 'Pending', label: '待构建', value: '0' },
  { key: 'Queuing', label: '排队中', value: 1 },
  { key: 'Building', label: '构建中', value: 2 },
  { key: 'Succeed', label: '构建完成', value: 3 },
  { key: 'Failed', label: '构建失败', value: 4 },
  { key: 'Canceled', label: '被取消', value: 5 },
  { key: 'Published', label: '已发布', value: 6 },
] as const;

const jobRunStateEnum = toEnum(jobRunState);
```

2. 使用枚举值

直接使用值（`value`）

```ts
console.log(JobRunStateEnum.Pending); // '0'

if (record.runState === JobRunStateEnum.Succeed) {
  console.log('构建成功'); // 构建成功
}
```

使用枚举中定义的其他属性

```ts
JobRunStateEnum.get('Building'); // // { key: 'Building', label: '构建中', value: 2, color: 'red' }
JobRunStateEnum.get('Building').color; // 'red'
```

3. 使用枚举数组
```ts
JobRunStateEnum.toOptions(); // [{ key: 'Pending', label: '待构建', value: '0' }, ...]
```
使用 `.toOptions()` 方法得到原始的枚举定义数组，你可以直接使用该数组渲染你的枚举选择框，或其他可交互组件。
```html
<a-select :options="JobRunStateEnum.toOptions()" />
```

## ❓ Why
为什么需要使用这个库？
npm package: @kortin/unocss-preset
Description: Useful preset for UnoCSS to avoid non-essential classes
Author: kortin.zhou
Latest version: 0.0.6

# @kortin/unocss-preset

Useful preset for [UnoCSS](https://github.com/unocss/unocss) to avoid non-essential classes.

## Installation

```shell
npm i @kortin/unocss-preset --save-dev
```

## Usage

To use this preset, simply include it in your UnoCSS configuration. This preset helps you to avoid writing repetitive and non-essential classes by providing utility classes for common layout patterns.

For Example:
```html
<div class="flex justify-center items-center"></div>
<!-- shortcut to be -->
<div class="flex-center"></div>
```

### Rules & Shortcuts Details

This preset provides the following utility classes:

#### Center

| Class Name | Properties |
|------------|------------|
| `flex-center` | `display: flex`<br>`align-items: center`<br>`justify-content: center` |
| `flex-col-center` | `display: flex`<br>`flex-direction: column`<br>`align-items: center`<br>`justify-content: center` |
| `absolute-center` | `position: absolute`<br>`top: 50%`<br>`left: 50%`<br>`transform: translate(-50%, -50%)` |
| `fixed-center` | `position: fixed`<br>`top: 50%`<br>`left: 50%`<br>`transform: translate(-50%, -50%)`<br>`z-index: 99` |
| `grid-center` | `display: grid`<br>`place-items: center` |
| `inline-center` | `display: inline-flex`<br>`align-items: center`<br>`justify-content: center` |


#### Flex

| Class Name | Properties |
|------------|------------|
| `flex-row` | `display: flex`<br>`flex-direction: row` |
| `flex-col` | `display: flex`<br>`flex-direction: column` |
| `flex-reverse` | `display: flex`<br>`flex-direction: row-reverse` |
| `flex-col-reverse` | `display: flex`<br>`flex-direction: column-reverse` |
| `flex-between` | `display: flex`<br>`justify-content: space-between`<br>`align-items: center` |
| `flex-around` | `display: flex`<br>`justify-content: space-around`<br>`align-items: center` |
| `flex-evenly` | `display: flex`<br>`justify-content: space-evenly`<br>`align-items: center` |
| `flex-start` | `display: flex`<br>`justify-content: flex-start`<br>`align-items: center` |
| `flex-end` | `display: flex`<br>`justify-content: flex-end`<br>`align-items: center` |
| `flex-wrap` | `display: flex`<br>`flex-wrap: wrap` |
| `flex-nowrap` | `display: flex`<br>`flex-wrap: nowrap` |

#### Grid

| Class Name | Properties |
|------------|------------|
| `grid-rows-{n}` | `display: grid`<br>`grid-template-rows: repeat(n, minmax(0, 1fr))` |
| `grid-cols-{n}` | `display: grid`<br>`grid-template-columns: repeat(n, minmax(0, 1fr))` |

#### Border

| Class Name | Properties |
|------------|------------|
| `b-{size}` | `border-width: {size}`<br>`border-style: solid` |
| `b-{x/y}-{size}` | Applies border to x (left/right) or y (top/bottom) with specified size |
| `b-{r/l/t/b/s/e}-{size}` | Applies border to specific direction (right/left/top/bottom/start/end) |

Note: For border utilities, if size is not specified, it defaults to 1px. Size can be specified with or without units.


## License

MIT License &copy; 2024-PRESENT [kortin.zhou](https://github.com/kortin99)
npm package: @kortix/kortix-oc
Description: Standalone Kortix OpenCode runtime package with a minimal entry config and plugin runtime
Latest version: 0.1.5

# @kortix/kortix-oc

Standalone source-of-truth package for the Kortix OpenCode runtime.

## OpenCode setup

The package is published on npm as `@kortix/kortix-oc`, and `latest` currently points to `0.1.1`.

For the published package, add a single plugin entry:

```jsonc
{
  "plugin": ["@kortix/kortix-oc@^0.1.1"]
}
```

For a local workspace checkout, use a filesystem path to the package root:

```jsonc
{
  "plugin": ["/absolute/path/to/computer/packages/kortix-oc/"]
}
```

The root plugin entry auto-loads the Kortix agent, commands, skills, tools, provider defaults, and Context7 wiring. Do not manually copy `agents/`, `commands/`, or `skills/` into your OpenCode config.
npm package: @kortix/tunnel
Description: Kortix Tunnel — local agent CLI that bridges your machine to Kortix cloud sandboxes
Author: Kortix AI
Latest version: 0.1.1

# @kortix/tunnel

Local agent CLI that bridges your machine to Kortix cloud sandboxes via a secure reverse-tunnel.

## Quick Start

```bash
npx @kortix/tunnel connect \
  --tunnel-id <id> \
  --token <token> \
  --api-url <url>
```

The connect command is generated for you in the Kortix dashboard when you create a new tunnel connection.

## Commands

| Command | Description |
|---------|-------------|
| `connect` | Connect and start handling RPC requests |
| `status` | Check tunnel connection status |
| `permissions` | List active permissions for this tunnel |
| `help` | Show help |

## Options

| Flag | Env Variable | Description |
|------|-------------|-------------|
| `--token` | `KORTIX_TUNNEL_TOKEN` | API token |
| `--tunnel-id` | `KORTIX_TUNNEL_ID` | Tunnel ID |
| `--api-url` | `KORTIX_API_URL` | API URL (default: `http://localhost:8008`) |

Config can also be stored in `~/.kortix-tunnel/config.json`.

## Capabilities

Once connected, the tunnel agent exposes three capability sets to the cloud sandbox:

- **Filesystem** -- read/write files on your local machine
- **Shell** -- execute commands locally
- **Desktop** -- screenshots, mouse/keyboard control, accessibility tree, window management

All operations are permission-gated and HMAC-signed.

## Requirements

- Node.js >= 22.0.0
npm package: @kortoaus/barcode-parser
Description: A lightweight TypeScript library for reading barcode data.
Author: kortoaus
Latest version: 1.0.1

# @kortoaus/barcode-parser

A lightweight TypeScript library for parsing and validating barcode data.

---

## 🚀 Installation

```sh
npm install @kortoaus/barcode-parser
```

## 📦 Usage

```typescript
import scanFunc, {
  validateEan13,
  genEan13CheckDigits,
} from "@kortoaus/barcode-parser";

const barcode = "9321234567890";

// Scan barcode with default timezone (Australia/Sydney)
const result = scanFunc(barcode);
console.log(result);

// Scan barcode with custom timezone
const resultWithTZ = scanFunc(barcode, "Asia/Seoul");
console.log(resultWithTZ);

// Validate EAN13 barcode
const isValid = validateEan13(barcode);
console.log(isValid); // true or false

// Generate EAN13 check digit from 12-digit input
const checkDigit = genEan13CheckDigits("932123456789");
console.log(checkDigit); // "0"
```

## 📝 API

### `scanFunc(barcode: string, tz?: string)`

Parses barcode information with optional timezone parameter (default: `Australia/Sydney`).

Returns an object:

```typescript
{
  type: BarcodeType;
  itemCode: string;
  barcode: string;
  weight: number;
  date: Date | null;
  dateNumber: number | null;
  serial: string | null;
  totalPrice: number | null;
}
```

### `validateEan13(input: string): boolean`

Validates the provided EAN13 barcode.

### `genEan13CheckDigits(input: string): string | null`

Generates the EAN13 check digit from a 12-digit numeric string.

---

## ⚙️ Supported Barcode Types

- `ean13`
- `ean13PE` (EAN13 with Price Embedded)
- `gtin`
- `239`
- `ect`
- `none` (unrecognized barcode)

---

## 🧑‍💻 Author

[kortoaus](https://github.com/kortoaus)

---

## 📄 License

[MIT](LICENSE)
npm package: @kortoaus/cas-scale
Description: A lightweight TypeScript library for reading weight data from CAS PD-II serial scales.
Author: kortoaus
Latest version: 1.0.4

# @kortoaus/cas-scale

A lightweight TypeScript library for interfacing with CAS PD-II electronic weighing scales over RS-232 serial communication.  
Automatically requests and parses weight data from the scale, using the `serialport` package under the hood.

> ✅ **Tested and confirmed to work with CAS PD-II in ECR-TYPE 2 (STX/ETX protocol mode) only.**

---

## ✨ Features

- ✅ Automatically sends weight request commands (`W`)
- ✅ Parses 7-byte responses from CAS PD-II scale
- ✅ Emits weight in kilograms via callback
- ✅ Works with Node.js & TypeScript
- ✅ Tiny, dependency-light wrapper

---

## 📦 Installation

```bash
npm install @kortoaus/cas-scale
```

---

## 🚀 Usage

```ts
import { initializeScale } from "@kortoaus/cas-scale";

initializeScale("/dev/tty.usbserial-B002EF3X", (weight) => {
  console.log("Weight:", weight, "kg");
});
```

Optional error callback:

```ts
initializeScale(
  "/dev/tty.usbserial-B002EF3X",
  (weight) => {
    console.log("Weight:", weight);
  },
  (err) => {
    console.error("Scale error:", err);
  }
);
```

---

## ⚙️ Scale Setup Instructions

> Ensure your CAS PD-II scale is configured as follows:

| Setting      | Value  |
| ------------ | ------ |
| **ECR Type** | `2`    |
| Baud Rate    | `9600` |
| Data Bits    | `7`    |
| Parity       | `Even` |
| Stop Bits    | `1`    |

To change ECR Type:

1. Turn off the scale
2. Hold `ZERO` + `TARE` and power on to enter setup mode
3. Navigate to `Ecr` setting and set to `2`
4. Use `TARE` (long press) to save and proceed

---

## 🧪 Tested On

- CAS PD-II with firmware version supporting ECR-TYPE 2
- macOS + USB-to-Serial adapter (FTDI, CH340 confirmed)
- Node.js 18+

---

## 📝 License

MIT — © kortoaus
npm package: @kortoaus/cf-ddns
Description: Automated DDNS updater for Cloudflare DNS records using their API
Author: kortoaus
Latest version: 1.0.0

# @kortoaus/cf-ddns

A minimal Cloudflare DDNS (Dynamic DNS) updater written in TypeScript using native `fetch` and zero dependencies (except dotenv).  
Designed to run as a single execution task via CLI or Docker for maximum portability and efficiency.

---

## ✨ Features

- 🔁 Public IP detection using `https://api.ipify.org`
- 🌐 Cloudflare A record auto-updater
- ⚡ Super lightweight (no axios, no cron dependencies)
- 🐳 Docker-friendly
- 🔒 `.env` driven config
- 🧠 Perfect for cron jobs, CI, or lightweight server automation

---

## 🚀 Quick Start

### 1. Install

```bash
npm install -g @kortoaus/cf-ddns
```

Or clone and run locally:

```bash
git clone https://github.com/kortoaus/cf-ddns.git
cd cf-ddns
npm install
npm run build
npm run ddns
```

---

### 2. Environment Setup

Create a `.env` file in the root directory with the following:

```env
CF_API_TOKEN=your_cloudflare_api_token
CF_ZONE_ID=your_zone_id
CF_RECORD_ID=your_dns_record_id
CF_RECORD_NAME=home.example.com
```

---

## 🛠 Usage

```bash
# run once
node dist/index.js

# or with npm script
npm run ddns

# or from cron
*/5 * * * * docker run --rm --env-file ~/.cf-ddns.env ghcr.io/kortoaus/cf-ddns:latest
```

---

## 🐳 Docker Example

```Dockerfile
FROM node:18-alpine
WORKDIR /app
COPY . .
RUN npm install --production && npm run build
CMD ["node", "dist/index.js"]
```

---

## 📦 Package Details

- Main: `dist/index.js`
- Type: `module` (ESM)
- CLI-ready: just add a shebang + bin in package.json if needed
- Compatible with Node.js >= 18

---

## 📄 License

MIT © kortoaus
npm package: @kortoaus/serial-zpl
Description: A lightweight TypeScript library for sending ZPL data to serial ports. and network.
Author: kortoaus
Latest version: 1.0.0

# @kortoaus/serial-zpl

> 🚀 A lightweight TypeScript library for sending ZPL (Zebra Programming Language) data via serial ports or network sockets. Built for speed and simplicity.

---

## ✨ Features

- 🖨️ Send ZPL to USB/Serial printers (Zebra, Bixolon, etc.)
- 🌐 Send ZPL to network printers (TCP/IP, port 9100)
- 🧠 Smart port filtering by manufacturer
- ⚡ Lightweight, no native build dependencies
- 🔧 Fully written in TypeScript

---

## 📦 Installation

```bash
npm install @kortoaus/serial-zpl
```

> Requires Node.js 16 or later

---

## 🚀 Usage

### List available serial ports

```ts
import { listSerialPorts } from "@kortoaus/serial-zpl";

const ports = await listSerialPorts();
console.log(ports);
// [{ path: "/dev/ttyUSB0", manufacturer: "FTDI", ... }]
```

### Send ZPL over serial (USB/RS232)

```ts
import { sendZplBySerial } from "@kortoaus/serial-zpl";

await sendZplBySerial("/dev/ttyUSB0", "^XA^FO50,50^FDHello via Serial^FS^XZ");
```

### Send ZPL over network (TCP)

```ts
import { sendZplByNetwork } from "@kortoaus/serial-zpl";

await sendZplByNetwork(
  "192.168.0.123",
  "^XA^FO50,50^FDHello via Network^FS^XZ"
);
// Optional third argument: port (default is 9100)
```

---

## 📁 API

### `listSerialPorts(): Promise<PortInfo[]>`

Returns a list of available serial ports, filtered by known USB-to-Serial manufacturers (`FTDI`, `WCH`, `Prolific`, etc.).

---

### `sendZplBySerial(portPath: string, zpl: string): Promise<void>`

Sends ZPL string to a serial port.  
Auto-handles opening and closing the port.

---

### `sendZplByNetwork(address: string, zpl: string, port = 9100): Promise<void>`

Sends ZPL string over TCP to the printer at the given IP and port.

---

## 🧱 Supported Environments

- ✅ macOS
- ✅ Windows
- ✅ Linux

---

## 🔐 License

MIT © [kortoaus](https://github.com/kortoaus)

---

## 💬 Feedback & Contributions

Issues and PRs welcome at [github.com/kortoaus/serial-zpl](https://github.com/kortoaus/serial-zpl)