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

@polyglot-img/cli

v0.1.3

Published

Polyglot 文件引擎的命令行入口,基于 [Commander.js](https://github.com/tj/commander.js)。

Readme

@polyglot-img/cli

Polyglot 文件引擎的命令行入口,基于 Commander.js。

安装

# 本包是 monorepo 内部包;运行需安装 workspace 依赖
npm install

命令

polyglot --help

create

合成前端(PNG/JPEG)+ 后端(ZIP)文件。

polyglot create \
  --front ./photo.jpg \
  --back zip \
  --add readme.txt:"Hello Polyglot" \
  --add config.json '{"key":1}' \
  --add empty.dat \
  --output image.zip

选项:

| 选项 | 必填 | 说明 | | ------------------- | ---- | ---------------------------------------------- | | --front <path> | ✅ | 前端图片路径 | | --back <format> | | 后端格式,默认 zip | | --add <name:data> | | 归档条目,可重复(data 省略时写入空 Buffer) | | --output <path> | ✅ | 输出文件路径 |

安全:extract 命令会过滤掉 .. 与绝对路径条目,避免 Zip Slip 攻击。

inspect

轻量检查文件是否 polyglot 并打印元数据。

polyglot inspect image.zip
# Polyglot: true
# Front: JPEG
# Front size: 23456 bytes
# Back: ZIP
# Back entries: 3

list

列出归档内所有条目名。

polyglot list image.zip
# readme.txt
# config.json
# empty.dat

extract

把归档内容解压到目录(自动跳过可疑条目名)。

polyglot extract image.zip ./output/
# Extracted: readme.txt
# Extracted: config.json
# Extracted: empty.dat

参数:

| 位置 | 说明 | | -------------- | ---------------------------- | | <path> | 源 polyglot 文件 | | <output-dir> | 目标目录(不存在会自动创建) |

CLI 内部实现注意

@polyglot-img/cli 直接 require 了 @polyglot-img/sdk 单例,所有命令共用同一份引擎状态。如需独立引擎,改用 @polyglot-img/core 自行构建。

开发

npm run build -w @polyglot-img/cli
npm run typecheck -w @polyglot-img/cli
npm test