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

lxx-cli

v1.1.2

Published

```bash #1.连接 npm link系统才能到到路径 #2.配置 #!/usr/bin/env node #3.安装commander npm install commander(版本信息) #4.查看版本号 const program=require('commander'); program.version('1.0.0');(写死)->program.version(require('./package.json').version,'-v,--version');实

Downloads

13

Readme

编写一个自己的脚手架

1.使用自己命名的命令运行

创建helpOptions

#1.连接
	npm link系统才能到到路径
#2.配置
	#!/usr/bin/env node
#3.安装commander
	npm install commander(版本信息)
#4.查看版本号
const program=require('commander');
program.version('1.0.0');(写死)->program.version(require('./package.json').version,'-v,--version');实现多指令执行
program.parse(process.argv);(解析)
#5.增加自己的options
program.option("命令1 || 命令2 <dest>(路径)","命令的解释")只要写上命令,后面的路径也要跟上,不然会报错
eg:program.option("-d --dest <dest> ","新建一个文件夹存放位置在<dest>")
#6.监听指令
program.on()

创建createCommands

eg:lxx create demo
program.command('create <peoject> [others...](可变长参数)')
	   .description('clone repository into a folder')//描述信息
	   .action((peoject,others)=>{
	   	  //把github仓库的文件拉到demo文件
	   	  //涉及到action函数的,进行封装
	   	  
	   })//回调函数
对action处理
//1.克隆一个项目
使用download-git-repo
	npm install download-git-repo
细节:
使用util 将回调函数转为promise
    const { promisify }= require('util')
    const download=promisify(require('download-git-repo'))

//2.执行npm install
//3.运行 npm run serve
//4.打开浏览器

image-20220521135104765

执行终端命令相关代码

const {spawn} =require('child_process')
将加载信息显示出来
const {spawn}=require('child_process');
const commandSpawn=(...args)=>{
  return new Promise((resolve,reject)=>{
    const childrenProcess=spawn(...args);
    //显示下载进度
    childrenProcess.stdout.pipe(process.stdout);
    childrenProcess.stderr.pipe(process.stderr)
    //监听是否下载完成
    childrenProcess.on("close",()=>{
      resolve()
    })
  })
};
window电脑运行的是npm.cmd
const command=process.platform==='win32' ? 'npm.cmd' : 'npm'

打开浏览器

npm install open
const open=require('open')
open('http://localhost:8080')

添加组件的action

1.编写对应的模板
2.编译ejs模板(封装函数)
npm install ejs
const path=require('path')
const ejs=require('ejs')
const compile=(tempateName(模板名称),data)=>{
	const templatePosition=`../template/${templateName}`;
	const templatePath=path.resolve(__dirname,templatePath);
	efs.renderdFile(路径,)
}

发布npm

1.npm login
3.npm publish

image-20220521205649594

image-20220521210258737

image-20220521210303559

image-20220521210308676