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 🙏

© 2024 – Pkg Stats / Ryan Hefner

zs-vue-cli

v1.2.1

Published

一个前端模板快速创建的脚手架

Downloads

31

Readme

此自定义脚手架用到了如下命令 commander: 命令行工具 inquirer: 交互式命令行工具 ora: 用于loading效果展示 fs-extra: node 文件管理模块 axios: 用来发送请求 获取远程仓库列表 download-git-repo: 用来下载远程模板

本地调试环境搭建 创建完成后,我们不能直接执行zs-vue-cli命令,需要搭建一个本地调式的环境,这部分最简单的就是 npm link, 这个命令就是将本地的项目链接到全局,等同于 npm i -g xxx.

Inquirer.js试图为NodeJs做一个可嵌入式的美观的命令行界面。它的功能主要是:

询问操作者问题 获取并解析用户输入 检测用户回答是否合法 管理多层级的提示 提供错误回调 示例: let inquirer = require('inquirer') inquirer.prompt([ { type: 'confirm', name: 'handsome', message: '我难道不是世界上最帅的男人吗?啦啦啦 1哈 2哈 3哈 main1美 dev2美 dev3美 main2美 main3美 dev5美 dev6美 dev7美 dev8美 main9 main10 dgit1', default: true } ]).then((answers) => { console.log(answers) })

download-git-repo 这个看名字大概就能猜出它是干嘛的了,没错—它就是帮我们完成下载远程仓库的,它的用法也比较简单,示例如下:

const download = require('download-git-repo') download(repository, destination, options, callback)

其中 repository 是远程仓库地址;destination是存放项目的文件夹,下载完之后会默认建立在本目录下;options 是一些选项,比如 { clone:boolean } 表示用 http download 还是 git clone 的形式下载,callback就是下载完成之后的回调函数了。

commander 用于帮助快速开发Node.js命令行工具的库, 使用文档 chalk chalk是一个颜色的插件。可以通过chalk.green(‘success’)来改变颜色,使用文档 download-git-repo 用来通过git下载项目模板的插件,使用文档 ora 用于实现node命令环境的loading效果,并显示各种状态的图标, 使用文档 inquier 用于命令行交互问询等, 使用文档 metalsmith 一个静态网站生成器,可以用在批量处理模板的场景。使用文档 handlebars 模板引擎工具,可用于修改package.json中相关字段,使用文档 log-symbols 用于在打印输出的内容中加入icon更友好,使用文档 rimraf 在node环境下使用unix 命令rm -rf来删除文件

需要搭建一个本地调式的环境,这部分最简单的就是 npm link, 这个命令就是将本地的项目链接到全局,等同于 npm i -g xxx.

发布到npm 的步骤 1、npm login 输入 npm 官网的账号和密码

2、npm publish 进行发布

3、npm install -g zs-vue-cli (更新到最新版本也一样用这个命令) 全局安装脚手架命令行工具