@aoberoi/chokidar-cli

中文文档
2.0.0发布于 2018/12/25MIT近 30 天下载 4375

超快跨平台命令行工具来监视文件系统的变化.

中文使用文档
文档目录3 节
  1. 安装
  2. 使用量
  3. 鸣谢

乔基达尔CLI

Build Status Build Status

快速跨平台命令行工具来监视文件系统的变化.

基本手表库是 乔基达尔这是最好的表之一 节点水电费。 Chokidar是战斗测试.

安装

如果你只需要国家防范机制的脚本:

npm install @aoberoi/chokidar-cli

或全球

npm install -g @aoberoi/chokidar-cli

使用量

默认 chokidar 串流改变所有模式以显示 :

$ chokidar '**/*.js' '**/*.less'
change:test/dir/a.js
change:test/dir/a.less
add:test/b.js
unlink:test/b.js

每个变化都以格式表示 event:relativepath可能的活动: add, (中文(简体) ), unlink, (中文(简体) ), addDir, (中文(简体) ), unlinkDir, (中文(简体) ), change。 。 。 .

仅在每次更改上输出相对路径

$ chokidar '**/*.js' '**/*.less' | cut -d ':' -f 2-
test/dir/a.js
test/dir/a.less
test/b.js
test/b.js

运行 npm 运行构建 -js 当前工作目录树中任何 .js 文件更改时

chokidar '**/*.js' -c 'npm run build-js'

在网络目录中观看必须使用投票

chokidar '**/*.less' -c 'npm run build-less' --polling

将路径和事件细节传递到您的自定义命令

chokidar '**/*.less' -c 'if [ "{event}" = "change" ]; then npm run build-less -- {path}; fi;'

详细帮助

Usage: chokidar <pattern> [<pattern>...] [options]

<pattern>:
Glob pattern to specify files to be watched.
Multiple patterns can be watched by separating patterns with spaces.
To prevent shell globbing, write pattern inside quotes.
Guide to globs: https://github.com/isaacs/node-glob#glob-primer


Options:
  -c, --command           Command to run after each change. Needs to be
                          surrounded with quotes when command contains spaces.
                          Instances of `{path}` or `{event}` within the command
                          will be replaced by the corresponding values from the
                          chokidar event.
  -d, --debounce          Debounce timeout in ms for executing command
                                                                  [default: 400]
  -t, --throttle          Throttle timeout in ms for executing command
                                                                  [default: 0]
  -s, --follow-symlinks   When not set, only the symlinks themselves will be
                          watched for changes instead of following the link
                          references and bubbling events through the links path
                                                      [boolean] [default: false]
  -i, --ignore            Pattern for files which should be ignored. Needs to be
                          surrounded with quotes to prevent shell globbing. The
                          whole relative or absolute path is tested, not just
                          filename. Supports glob patters or regexes using
                          format: /yourmatch/i
  --initial               When set, command is initially run once
                                                      [boolean] [default: false]
  --concurrent            When set, command is not killed before invoking again
                                                      [boolean] [default: false]
  -p, --polling           Whether to use fs.watchFile(backed by polling) instead
                          of fs.watch. This might lead to high CPU utilization.
                          It is typically necessary to set this to true to
                          successfully watch files over a network, and it may be
                          necessary to successfully watch files in other non-
                          standard situations         [boolean] [default: false]
  --poll-interval         Interval of file system polling. Effective when --
                          polling is set                          [default: 100]
  --poll-interval-binary  Interval of file system polling for binary files.
                          Effective when --polling is set         [default: 300]
  --verbose               When set, output is more verbose and human readable.
                                                      [boolean] [default: false]
  --silent                When set, internal messages of chokidar-cli won't be
                          written.                    [boolean] [default: false]
  -h, --help              Show help                                    [boolean]
  -v, --version           Show version number                          [boolean]

Examples:
  chokidar "**/*.js" -c "npm run build-js"  build when any .js file changes
  chokidar "**/*.js" "**/*.less"            output changes of .js and .less
                                            files

鸣谢

感谢 金莫·布伦费尔特 开始这个项目并走得很远 一、导 言 维持了临时叉以登陆一个直到2018年12月才取得任何进展的地物,在该地上 我决定去掉"临时"的标签 没有所有贡献者,这个项目是不可能的 原计划.

版本与发布记录

@aoberoi/chokidar-cli 共发布 2 个版本,首次发布于 2016/04/22;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.0.0latest2018/12/257 年前
1.3.02016/04/2210 年前

关于 @aoberoi/chokidar-cli 的常见问题

@aoberoi/chokidar-cli 是什么?

超快跨平台命令行工具来监视文件系统的变化.

如何安装 @aoberoi/chokidar-cli?

在项目目录运行 npm install @aoberoi/chokidar-cli,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 chokidar,可以用 npx chokidar 直接运行。

@aoberoi/chokidar-cli 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aoberoi__chokidar-cli 是否存在。

@aoberoi/chokidar-cli 可以商用吗?

@aoberoi/chokidar-cli 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@aoberoi/chokidar-cli 的下载量有多少?

根据 npm 官方下载统计,@aoberoi/chokidar-cli 在 2026/10/06 – 2026/11/04 这 30 天内被下载 4,375 次,日均约 146 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aoberoi/chokidar-cli 还在维护吗?

最新版本 2.0.0 发布于 2018/12/25(7 年前);至今共发布 2 个版本,其中过去 12 个月发布了 0 个;首次发布于 2016/04/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。