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

docs_temp

v1.1.1

Published

命令行工具,用于自动生成项目文档结构和模板文件

Readme

docs_temp

一个命令行工具,用于自动生成项目文档结构和模板文件。

功能特点

  • 一键生成标准化的文档结构
  • 支持自定义模板目录
  • 交互式配置项目信息
  • 自动备份已存在的文件
  • 完善的错误处理和提示
  • 支持多种文档类型:
    • 产品需求文档 (PRD)
    • 用户体验设计规范
    • 用户界面设计规范
    • 技术规范文档
    • 隐私政策
    • 用户协议
    • 技术支持文档

安装和使用

方式一:使用 npx(推荐)

无需安装,直接运行:

npx docs_temp init

方式二:全局安装

npm install -g docs_temp

# 然后使用
docs_temp init

使用方法

初始化文档结构

# 使用默认配置
docs_temp init

# 指定自定义模板目录
docs_temp init --template-dir ./my-templates

# 指定输出目录
docs_temp init --output-dir ./my-docs

交互式配置

运行 init 命令后,工具会引导您完成以下配置:

  1. 输入项目基本信息:

    • 项目名称(必填)
    • 作者信息(可选)
    • 版本号(默认:1.0.0)
  2. 选择要生成的文档:

    • 使用空格键选择/取消选择文档
    • 使用回车键确认选择

目录结构

生成的文档结构如下:

docs/
├── Prd.md                 # 产品需求文档
├── UX_design.md      # 用户体验设计规范
├── UI_design.md      # 用户界面设计规范
├── Techinical_spec.md     # 技术规范文档
├── Privacy_policy.md      # 隐私政策
├── User_agreement.md      # 用户协议
└── Techinical_support.md  # 技术支持文档

模板变量

所有文档模板支持以下变量:

  • PROJECT_NAME: 项目名称
  • CREATED_DATE: 创建日期
  • AUTHOR: 作者信息
  • VERSION: 版本号

自定义模板

您可以创建自己的模板目录,目录结构应与默认模板相同。模板使用 EJS 语法,支持:

  • 条件渲染
  • 循环结构
  • 引入子模板

错误处理

工具提供了友好的错误提示和解决方案建议,常见错误包括:

  • 模板文件缺失或格式错误
  • 文件操作权限问题
  • 目录已存在
  • 配置参数错误

注意事项

  1. 文件覆盖:

    • 当目标文件已存在时,工具会自动创建备份
    • 备份文件格式:原文件名.时间戳.bak
  2. 权限要求:

    • 需要目标目录的写入权限
    • 如遇权限问题,请检查目录权限或使用管理员权限运行

环境要求

  • Node.js >= 14.0.0
  • npm >= 6.0.0

许可证

MIT