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

ccl-watch

v1.0.0

Published

A CLI tool to watch file changes and copy changed parts to a target directory.

Readme

CLI Watcher

ccl-watch 是一个基于 Node.js 的命令行工具,用于监听文件或目录的变化,并在文件变化时将发生变化的部分拷贝到指定目录。支持添加多个监听目录、启动/停止监听服务、查看当前监听目录、删除指定目录等功能,帮助开发者高效地管理文件监控与同步。

功能

  • 添加监听目录:可以添加一个或多个源目录和目标目录,自动监听源目录的文件变化,并将变化的文件拷贝到目标目录。
  • 启动文件监听:启动监听服务,自动监控文件变化。
  • 停止文件监听:停止正在进行的文件监听服务。
  • 查看监听目录:列出当前所有正在监听的目录及其对应的目标目录。
  • 删除监听目录:删除指定的监听目录。
  • 清空所有监听目录:清空所有的监听目录设置。
  • 帮助命令:显示命令行工具的帮助信息。

安装

本地安装

npm install ccl-watch --save-dev

全局安装

为了在命令行中直接使用 ccl-watch 命令,可以进行全局安装:

npm install -g ccl-watch

使用方法

添加监听目录

添加一个监听目录,当源目录中的文件发生变化时,将文件拷贝到目标目录。

ccl-watch add <srcDir> <destDir>

示例

ccl-watch add ./src ./dist

这会监听 ./src 目录的变化,并将发生变化的文件拷贝到 ./dist 目录。

启动监听服务

启动文件监听服务,开始监控所有已添加的目录。

ccl-watch start

停止监听服务

停止文件监听服务,停止对文件的监控。

ccl-watch stop

查看当前监听目录

查看当前正在监听的目录及其对应的目标目录。

ccl-watch ls

示例输出

1. ./src -> ./dist
2. ./assets -> ./public

删除指定监听目录

删除指定编号的监听目录。可以使用 ccl-watch ls 获取当前监听目录的编号。

ccl-watch delete <id>

示例

ccl-watch delete 1

这会删除编号为 1 的监听目录(例如 ./src -> ./dist)。

清空所有监听目录

清空所有已添加的监听目录设置。

ccl-watch clear

显示帮助信息

显示所有可用命令的帮助信息。

ccl-watch help

示例输出

CLI Watcher 帮助信息:

1. 添加监听目录: 
   ccl-watch add <srcDir> <destDir>
   - 监听 <srcDir> 目录,将变化的文件拷贝到 <destDir> 目录。

2. 启动文件监听:
   ccl-watch start
   - 启动服务,开始监听已添加的目录。

3. 停止文件监听:
   ccl-watch stop
   - 停止文件监听服务。

4. 查看当前监听的目录:
   ccl-watch ls
   - 查看当前正在监听的目录及其对应的目标目录。

5. 删除指定监听目录:
   ccl-watch delete <id>
   - 删除指定编号的监听目录。

6. 清空所有监听目录:
   ccl-watch clear
   - 清空所有已添加的监听目录。

7. 显示帮助信息:
   ccl-watch help
   - 显示所有命令的帮助信息。

使用以上命令进行管理和操作文件监听服务。

依赖

  • chokidar:用于监听文件或目录的变化,具有高效的性能。
  • fs-extra:提供额外的文件操作方法,支持递归复制文件夹。
  • chalk:在命令行中高亮打印输出信息,使用绿色表示成功,红色表示失败。

示例

  1. 添加监听目录
ccl-watch add ./src ./dist
  1. 启动监听服务
ccl-watch start
  1. 查看当前监听目录
ccl-watch ls
  1. 删除监听目录
ccl-watch delete 1
  1. 清空所有监听目录
ccl-watch clear