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

qxan-decoder-sdk

v0.1.2

Published

Client-side decoding library for AI-generated images and videos, powered by Qxan AI.

Readme

qxan-decoder-sdk

A powerful, client-side library for decoding AI-generated steganographic content from multiple formats (TT-tools, SS_tools, etc.). Supports images, videos, and password-protected content.

支持的格式

| 解码器 | 格式名称 | 密码支持 | LSB位深 | 特性 | |--------|----------|----------|---------|------| | QxanDecoder | Qxan AI 原生格式 | ❌ | 1位 | 视频隐藏在PNG中 | | TTDecoderV1 | TT-tools V1 | ❌ | 1位 | 跳过上下20%,抗水印 | | TTDecoderV2 | TT-tools V2 | ❌ | 8位 | CRC16校验,跳过顶部6% | | TTDecoderPW | TT-tools PW | ✅ | 1位 | 密码保护,跳过顶部5% | | SSDecoder | SS_tools | ✅ | 2/6/8位 | 自动位深检测,区域屏蔽 |

安装

npm install qxan-decoder-sdk
# 或
pnpm add qxan-decoder-sdk

快速开始

1. QxanDecoder (原生格式)

import { QxanDecoder } from "qxan-decoder-sdk";

// 解码文件
const result = await QxanDecoder.decode(fileInput.files[0], {
  expect: "video", // 或 'image' 提取关键帧
  onProgress: (msg) => console.log(msg),
});

if (result.type === "video") {
  videoElement.src = result.videoUrl;
  console.log("元数据:", result.metadata);
}

2. TTDecoderV1 (TT-tools V1)

import { TTDecoderV1 } from "qxan-decoder-sdk";

const result = await TTDecoderV1.decode(imageFile, {
  expect: "video",
  onProgress: (msg) => console.log("[TT-V1]", msg),
});

3. TTDecoderV2 (TT-tools V2)

import { TTDecoderV2 } from "qxan-decoder-sdk";

const result = await TTDecoderV2.decode(imageFile, {
  expect: "image", // 提取关键帧
  maxFrames: 6,
  onProgress: (msg) => console.log("[TT-V2]", msg),
});

4. TTDecoderPW (TT-tools 密码版)

import { TTDecoderPW } from "qxan-decoder-sdk";

const result = await TTDecoderPW.decode(
  imageFile,
  "your-password", // 密码参数
  {
    expect: "video",
    onProgress: (msg) => console.log("[TT-PW]", msg),
  }
);

5. SSDecoder (SS_tools)

import { SSDecoder } from "qxan-decoder-sdk";

const result = await SSDecoder.decode(
  imageFile,
  "optional-password", // 可选密码
  {
    expect: "image", // 对于 binpng 格式可提取帧
    maxFrames: 8,
    onProgress: (msg) => console.log("[SS]", msg),
  }
);

通用选项

所有解码器都支持以下选项:

interface DecodeOptions {
  /**
   * 期望输出格式
   * - 'video': 返回原始视频文件
   * - 'image': 提取视频的关键帧
   */
  expect: "image" | "video";

  /**
   * 当 expect='image' 时,最大提取帧数
   * 默认: 4
   */
  maxFrames?: number;

  /**
   * 进度回调函数
   */
  onProgress?: (msg: string) => void;
}

返回结果

interface DecoderResult {
  /** 内容类型 */
  type: "video" | "image";

  /** 解码后的视频 Blob */
  videoBlob: Blob;

  /** 视频 URL (可用于播放) */
  videoUrl: string;

  /** 提取的帧 (仅当 expect='image' 时) */
  frames?: string[]; // Blob URLs 数组

  /** 视频元数据 */
  metadata?: {
    duration: number; // 秒
    width: number;
    height: number;
    estimatedFrames: number; // 基于 16 FPS 估算
  };
}

浏览器要求

  • 所有解码器: 需要现代浏览器支持 CanvasImage API
  • QxanDecoder: 需要 SharedArrayBuffer 支持 FFmpeg WASM
    Cross-Origin-Opener-Policy: same-origin
    Cross-Origin-Embedder-Policy: require-corp

构建 & 发布

本地开发

# 安装依赖
pnpm install

# 开发模式 (监听文件变化)
pnpm dev

# 生产构建
pnpm build

发布到 npm

  1. 登录 npm (首次需要):

    npm login
    # 输入用户名、密码、邮箱
  2. 检查版本:

    # 查看当前版本
    npm view qxan-decoder-sdk version
    
    # 查看本地 package.json 版本
    cat package.json | grep version
  3. 构建 SDK:

    pnpm build
    # 检查 dist/ 目录是否生成正确
    ls dist/
  4. 发布:

    # 发布公开包
    npm publish
    
    # 或发布测试版本
    npm publish --tag beta
  5. 验证发布:

    # 安装刚发布的版本
    mkdir test-project
    cd test-project
    npm init -y
    npm install [email protected]
    
    # 测试导入
    node -e "console.log(require('qxan-decoder-sdk'))"

许可证

MIT