npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@composy/image-editor-core

v0.0.2

Published

Professional image editor library with annotations, filters, crop, and more

Readme

@composy/image-editor-core

Professional image editor library with annotations, filters, crop, and more

功能特性

  • 🚀 高性能核心引擎
  • 🎨 TypeScript 类型完整
  • 📦 支持 ESM / CJS 双格式输出

安装

npm install @composy/image-editor-core

快速开始

import {} from /* 需要的导出 */ '@composy/image-editor-core'

// 根据实际 API 使用

跨域导出

浏览器禁止导出被跨域图片污染的 canvas。默认 crossOrigin 为 anonymous,源站需要返回 CORS 响应头;如果源站不支持 CORS,请改用本地上传、data: URL 或同源 blob: URL。

import { Editor } from '@composy/image-editor-core'

const editor = new Editor({
  container: '#editor',
  image: 'https://third-party.example.com/a.jpg',
  crossOrigin: 'anonymous'
})

editor.setTool('move')

显式设置 crossOrigin: null 只适合预览无 CORS 图片,修改后的 canvas 不能导出。

异步加载与重置语义

  • 同一个 Editor 连续调用 loadImage() 时,只有最后一次请求可以提交到画布;被新请求取代的旧 Promise 会以 AbortError 结束,不会再覆盖新图片或触发错误态。
  • 调用 clearImage() 或 destroy() 会取消尚未完成的加载请求,避免异步回调在清空/销毁后重新写入画布。
  • rotate()、flipHorizontal()、flipVertical()、crop() 和 resize() 只修改当前编辑结果,不会覆盖原始基线;reset() 会恢复原始像素和原始 backing dimensions。对于 crossOrigin: null 的污染画布,重置会使用原始图片重新绘制,但仍不能导出像素。

目录结构

packages/core/
├── src/              # 源码
├── package.json
├── tsconfig.json     # ESM 构建配置
└── tsconfig.cjs.json # CJS 构建配置

License

MIT

构建与检查

pnpm build
pnpm type-check
pnpm type-check:cjs
pnpm lint:check

Builder 配置位于 .ldesign/builder.config.ts,TypeScript 与 ESLint 配置也统一位于 .ldesign/。构建输出为 dist、es、esm 与 lib,并对应 package exports。 包根目录的配置文件仅作为兼容转发入口。