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

printcd

v1.1.3

Published

生成代码快照工具 - 支持多种输出方式

Readme

功能特点

智能注释格式:根据文件类型自动选择适当的注释格式(JS/CSS使用/* */,Python使用#,HTML使用等)

忽略功能:默认忽略node_modules、.git、dist等目录,支持自定义忽略项

相对路径标注:在每个文件头部添加清晰的文件相对路径

文件类型支持:支持多种编程语言和文件类型

命令行和API:既可通过命令行使用,也可作为API集成到其他工具中

这个插件非常适合用于代码审查、文档生成、教学演示或创建项目概览等场景。它能够快速生成一个包含所有源代码的单一文本文件,每个文件都带有清晰的路径注释,便于查阅和分析。

安装

npm install -g printcd

命令行使用

# 输出到控制台
printcd ./src

# 输出到文件
printcd ./src -o snapshot.txt

# 忽略特定目录
printcd ./src -i node_modules,dist -o snapshot.txt

输出方式

默认输出到控制台

npx printcd ./

# 输出到文本文件
npx printcd ./ -o snapshot.txt

# 复制到剪贴板
npx printcd ./ -c

# 生成HTML文件(默认文件名:printcd.html)
npx printcd ./ -h

# 生成HTML文件并指定文件名
npx printcd ./src -h 

# 组合使用:复制到剪贴板并保存为文本文件
npx printcd ./src -o  -c

# 静默模式(无控制台输出)
npx printcd ./src -c -s