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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@web.worker/create-astro-exe

v1.2.5

Published

Create Astro applications with a single command

Downloads

16

Readme

@web.worker/create-astro-exe

一个用于快速创建 Astro 项目的 npm 模板包。

功能特性

  • 🚀 通过 npm create @web.worker/astro-exe 快速创建 Astro 项目
  • 📝 交互式配置项目信息(项目名、描述、作者等)
  • 🎨 内置完整的 Astro 项目模板
  • 📦 自动安装依赖(可选)
  • 🔧 自动初始化 Git 仓库(可选)
  • 🔄 模板变量替换系统

使用方法

基本用法

npm create @web.worker/astro-exe my-project

参数说明

该工具采用交互式方式收集配置;如果在不支持参数传递的环境(例如部分 npm create 场景)中使用,将采用默认值:

  • 默认安装依赖(可在交互中取消)
  • 默认初始化 Git 仓库,但不会自动提交(不执行 git add / git commit
  • 安装依赖时可选择包管理器(npm / yarn / pnpm),默认使用 npm

交互项说明

  • Project name:项目名称(可在命令行传入或交互输入)
  • Project description:默认值为“ - Astro application”,可编辑
  • Author name:默认从 git config --global user.name 回填,若未设置则为空
  • Install dependencies:是否安装依赖(默认是)
  • Choose a package manager:选择 npm / yarn / pnpm(仅当安装依赖为是时出现,默认 npm)
  • Initialize git repository:是否初始化 Git(默认是)

生成的项目结构

my-project/
├── .gitignore
├── README.md
├── astro.config.mjs
├── package.json
├── tsconfig.json
├── public/
│   └── favicon.svg
└── src/
    ├── components/
    │   └── Layout.astro
    └── pages/
        └── index.astro

开发

本地测试

  1. 克隆项目并安装依赖:
git clone <repository-url>
cd create-astro-exe
npm install
  1. 链接到全局:
npm link
  1. 构建并测试 CLI 工具:
npm run build
node dist/create-astro-exe.cjs test-project

项目结构

  • bin/ - CLI 入口文件
  • lib/ - 核心逻辑模块
  • template/ - Astro 项目模板文件
  • docs/ - 项目文档

发布到 npm

  1. 登录 npm:
npm login
  1. 发布包:
npm publish --access public

技术实现

  • CLI 框架: 基于 Node.js 原生模块
  • 交互式输入: 使用 inquirer
  • 模板引擎: 自定义变量替换系统
  • 文件操作: 使用 fs-extra 进行文件复制和处理

验收标准

  • ✅ 支持 npm create @web.worker/astro-exe 命令
  • ✅ 交互式配置项目信息
  • ✅ 生成完整可运行的 Astro 项目
  • ✅ 模板变量正确替换
  • ✅ 交互式依赖安装与 Git 初始化(默认初始化但不自动提交)
  • ✅ 依赖安装支持包管理器选择(npm / yarn / pnpm)
  • ✅ 生成的项目可正常启动开发服务器

许可证

MIT

作者

@web.worker team