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

koo-tools-cli

v1.0.19

Published

A tools CLI

Downloads

43

Readme

koo-tools-cli

一个简单的工具集cli

 ___  __    ________  ________                _________  ________  ________  ___       ________      
|\  \|\  \ |\   __  \|\   __  \              |\___   ___\\   __  \|\   __  \|\  \     |\   ____\     
\ \  \/  /|\ \  \|\  \ \  \|\  \  ___________\|___ \  \_\ \  \|\  \ \  \|\  \ \  \    \ \  \___|_    
 \ \   ___  \ \  \\\  \ \  \\\  \|\____________\  \ \  \ \ \  \\\  \ \  \\\  \ \  \    \ \_____  \   
  \ \  \\ \  \ \  \\\  \ \  \\\  \|____________|   \ \  \ \ \  \\\  \ \  \\\  \ \  \____\|____|\  \  
   \ \__\\ \__\ \_______\ \_______\                 \ \__\ \ \_______\ \_______\ \_______\____\_\  \ 
    \|__| \|__|\|_______|\|_______|                  \|__|  \|_______|\|_______|\|_______|\_________\
                                                                                        \|_________| 
                                                                                        

使用

koo:详情
koo list|l: 功能列表
koo compress|c: 使用图片压缩
...

功能

目前只有图片压缩

  1. 图片压缩 ...

技术选型

  1. node.js:整个脚手架工具的根本组成部分,推荐使用最新的版本。
  2. es6:新版本的node.js对于es6的支持度已经非常高,使用es6能够极大地提升开发效率和开发感受。
  3. commander:TJ大神开发的工具,能够更好地组织和处理命令行的输入。
  4. inquirer: 命令行与用户之间的交互
  5. chalk: 显示颜色字体
  6. figlet: 3D打印logo

整体架构

文件结构如下:

=================
  |__ bin
    |__ fork
  |__ command
    |__ compress.js
  |__ src
    |__ compress
  |__ node_modules
  |__ package.json
  |__ gulpfile.js

入口文件 首先建立项目,在package.json里面写入依赖并执行npm install:

"dependencies": {
  "chalk": "^1.1.3",
  "commander": "^2.9.0"
}

在根目录下建立\bin文件夹,在里面建立一个无后缀名的fork文件。 这个bin\fork文件是整个脚手架的入口文件,所以我们首先对它进行编写。

全局使用

为了可以全局使用,我们需要在package.json里面设置一下:

"bin": {
  "koo": "bin/fork"
},

本地调试的时候,在根目录下执行

npm link

即可把koo命令绑定到全局,以后就可以直接以koo作为命令开头而无需敲入长长的node koo之类的命令了。

现在我们的工具集cli已经搭建好了,一起来尝试一下吧!

使用测试

compress | c 图片压缩
大功告成啦!现在我们的工具集cli已经搭建完成了