Image processing shaped by a URL — for Node.js.
Resize, crop, watermark, convert — all expressed as a readable path, powered by sharp, and ready to drop into any Node.js project.
Online Demo · Playground · Docs · 中文说明
- 🔗 URL-driven — fully compatible with Aliyun OSS
x-oss-processsyntax. Drop existing URLs in and they just work. - ⛓ Chained builder API — fluent, fully typed TypeScript builder with IDE auto-completion.
- 🧰 12+ operations — resize, crop, rotate, flip, blur, watermark, format conversion, quality control, circle / rounded crop, indexed slice, auto-orient, and more.
- ⚡ Powered by sharp — battle-tested
libvipsbackend with stable, low-memory performance. - 📦 ESM + CJS — works with both module systems on Node.js 18+.
- 🔒 Strict input limits — sane defaults for size, dimensions and pixel count to keep your server safe.
npm install @imgx-kit/core sharp
# or
pnpm add @imgx-kit/core sharp
# or
yarn add @imgx-kit/core sharp
sharpis a peer dependency and must be installed separately.
import { processImage } from '@imgx-kit/core';
const buf = await processImage(
'./photo.jpg',
'image/resize,w_300/format,webp',
);import { imgx } from '@imgx-kit/core';
const buf = await imgx('./photo.jpg')
.resize({ w: 300 })
.format({ type: 'webp' })
.toBuffer();Input accepts a local path, Buffer, URL, or a Node Readable stream.
image/{op1},{param}_{value}[/{op2},{param}_{value}...]
Recommended order: resize → format → watermark → quality.
See the full operation reference for every parameter.
This is a pnpm + Turborepo monorepo.
| Path | Description |
|---|---|
packages/core/ |
@imgx-kit/core — the image processing library |
apps/web/ |
Marketing site, documentation and online Playground (Next.js 16) |
docs/ |
Internal planning notes |
User-facing docs live in apps/web/content/docs/{en,zh}/.
pnpm install # install all workspaces
pnpm build # build core + web
pnpm test # run all tests
pnpm web:dev # start the website locally on :3000| Command | What it does |
|---|---|
pnpm build |
Build every workspace via Turbo |
pnpm test |
Run all unit tests (Vitest) |
pnpm lint |
Lint every workspace |
pnpm web:dev |
Run the Next.js site locally |
pnpm web:build |
Build the website only |
The website (apps/web) is deployed to Vercel automatically by a GitHub Action on every push to main. See .github/workflows/deploy.yml.
Issues and pull requests are very welcome. If you plan to work on a sizeable change, please open an issue first to discuss the approach.
- Fork the repo and create your branch from
main. - Run
pnpm installand make your changes. - Add or update tests; make sure
pnpm testandpnpm lintpass. - Open a PR with a clear description.
MIT © imgx contributors
imgx 是一个 Node.js 图像处理工具集,核心库 @imgx-kit/core 完全兼容阿里云 OSS 的 x-oss-process URL 语法,底层由 sharp 驱动。它同时提供两套等价 API:
- URL 风格:把熟悉的
image/resize,w_300/format,webp直接喂进去; - 链式 Builder:完整 TypeScript 类型,IDE 自动补全,写起来更顺手。
仓库为 pnpm + Turborepo monorepo:
packages/core/—@imgx-kit/core库本体apps/web/— 官网、文档与在线 Playground(Next.js)
🔗 在线体验:https://imgx-kit.vercel.app | Playground:https://imgx-kit.vercel.app/zh/playground
快速开始:
pnpm install
pnpm web:dev # 本地启动官网更多用法详见 apps/web/content/docs/zh/ 或在线文档。