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

react-lyl-cli

v0.0.1

Published

react-cli

Readme

commander使用

option

    .option("-n, --name[items2]",'name description','default value')

    //如果没有参数 --name ,则program.opts()  --返回true   如果有参数 返回参数

command


    .command(名字<参数>).action(方法)
    参数回传给对应的action

inquirer

inquirer.prompt([]).then().catch()

问题对象具体配置项: type :input,number,confirm, list,rawlist,expand,checkbox,password,editor name :将答案存储在答案哈希中时使用的名称 message :问题 default:默认值 choices validate filter transformer when:(Function,Boolean)接收当前用户的答案哈希,并应返回true或false取决于是否应询问此问题。该值也可以是一个简单的布尔值

    inquirer.prompt([ {
  type: 'number', 
  name: 'number', 
  message: 'How much do you need?', 
  default: 1
}]).then((answers) => { 
  console.log('结果为:')
  console.log(answers)
})

inquirer.prompt([ {
  type: 'input', 
  name: 'size', 
  message: 'Select size: large, medium and small', 
  default: 'medium'
}]).then((answers) => { 
  console.log('结果为:')
  console.log(answers)
})

inquirer.prompt([ {
  type: 'list', 
  name: 'list', 
  message: 'What do you like to drink?', 
  choices: ['black-tea', 'green-tea', 'milk-tea'],
  default: 1
}]).then((answers) => { 
  console.log('结果为:')
  console.log(answers)
})

inquirer.prompt([ { 
  type: 'checkbox', 
  name: 'checkbox', 
  message: 'What do you like to drink?', 
  choices: ['black-tea', 'green-tea', 'milk-tea', new inquirer.Separator(), 'juice'], //可以在数组中插入分割符
  default: ['black-tea'] //这里需要用数组,不能像list一样用下标
}]).then((answers) => { 
  console.log('结果为:')
  console.log(answers)
})

inquirer.prompt([ { //当类型为confirm时,各配置项示例
    type: 'password', 
    name: 'password', 
    message: 'Please input password:', 
    mask: true
  }]).then((answers) => { 
    console.log('结果为:')
    console.log(answers)
  })

process.platform 属性返回字符串,用于标识运行 Node.js 进程的操作系统平台。