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

sz-node-script-cli

v1.0.0

Published

node-script develop tool

Downloads

13

Readme

sz-node-script-cli

基与工具类commander进行了二次封装,简化脚本在脚本参数解析时的代码复杂度,方便开发者快速开发脚本包 工具需要使用node14+ 使用mjs开发脚本模块

使用指南

  • 安装工具包
npm install sz-node-script-cli
  • 使用脚本工具开发脚本
import {scriptRunner} from "sz-node-script-cli";

const config = {
    version: '1.0.0'
    params:[
        ['mode','调用模式',true],
        ['debug','调试模式'],
        ['test  <char>','测试模式']
    ],
    run:({params})=>{
        ...    //脚本代码
    }
}

scriptRunner(config);
  • 支持的的命令

    • 输入 node index.mjs -h 会显示可以调用的命令

      -V, --version        output the version number
      -m, --mode           调用模式
      -d, --debug          调试模式
      -t, --test  <char>   测试模式
      -h, --help           display help for command 
        
    • mode属性为必设项,如果命令中不包含mode属性则会输出

         error: required option '-m, --mode ' not specified
    • debug 属性为bool,设置字符串的的话默认为true

    • test 必须是字符传,如果设置了属性不设置内容则会提示

      error: option '-t, --test  <char> ' argument missing
  • 备注: 基与commander进行了二次封装,如果需要更多功能可以参考commander