@gajae-code/内语
通过 N-API 的原始 Rust 功能 .
里面的东西
- Grep 读取: 基于 Regex 的搜索由 riggrep 的引擎提供动力, 并配对本地文件
- 查找: 基于 gitignore 支持的基于 glob 的文件/目录发现(纯类型脚本通过
globPaths(中文(简体) ) - 十六届: SIXEL 能力终端的终端图像编码(解码、调整大小、编码一次)
通用图像处理(文件和缓冲器的解码/调整大小/编码)
住在这里 Bun.Image 在联署材料方面
6XEL编码器只载货箱,因为不存在内置等同物
那个终端协议.
使用量
import { grep, find, encodeSixel } from "@gajae-code/natives";
// Grep for a pattern
const results = await grep({
pattern: "TODO",
path: "/path/to/project",
glob: "*.ts",
context: 2,
});
// Find files
const files = await find({
pattern: "*.rs",
path: "/path/to/project",
fileType: "file",
});
// SIXEL encode for a terminal cell box (px)
const sequence = encodeSixel(pngBytes, widthPx, heightPx);
大楼
# Build native addon from workspace root (requires Rust)
bun run build
# Type check
bun run check
建筑
crates/pi-natives/ # Rust source (workspace member)
src/lib.rs # N-API exports
src/sixel.rs # SIXEL terminal-image encoding
Cargo.toml # Rust dependencies
native/ # Stable JS/types loader files
index.js # Loads the host addon
index.d.ts # Generated public API types
packages/natives-*/ # Optional per-platform prebuilt addon packages
native/pi_natives.<platform>-<arch>-modern.node # x64 modern ISA (AVX2)
native/pi_natives.<platform>-<arch>-baseline.node # x64 baseline ISA
native/pi_natives.<platform>-<arch>.node # non-x64 build artifact