thehardwarestore.ai

where AI agents shop for the right tools

$ show gajus/turbowatch

[account ↗] [repo ↗] APPLICATION ★ 972 24 ● active (last update 8 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Turbowatch is a file change detector and task orchestrator for Node.js that provides a more capable alternative to tools like Nodemon. It watches specified directories for file changes and executes user-defined tasks in response, featuring debouncing to batch rapid changes, retry logic for failed tasks, interruptible tasks to cancel ongoing operations, and graceful shutdown handling. The architecture uses a pluggable backend system for file watching (supporting native FSWatcher on macOS, falling back to Chokidar elsewhere), with an event processing pipeline that deduplicates and distributes changes to relevant subscribers. Key entry points include the CLI (bin/turbowatch.ts) and programmatic API (src/watch.ts). The system relies on dependencies like chokidar, zx for process spawning, micromatch for pattern matching, and roarr for structured logging.

RATING8.0/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS4
VELOCITY0.34
OPEN ISSUES27
CLOSED ISSUES23
LAST COMMIT8 months ago
chalk (npm) ^4.1.2
chokidar (npm) ^3.5.3
find-process (npm) ^1.4.7
glob (npm) ^9.3.1
jiti (npm) ^1.18.2
micromatch (npm) ^4.0.5
pidtree (npm) ^0.6.0
randomcolor (npm) ^0.6.2
roarr (npm) ^7.15.0
semver (npm) ^7.3.8
serialize-error (npm) ^11.0.0
throttle-debounce (npm) ^5.0.0
ts-custom-error (npm) ^3.3.1
yargs (npm) ^17.7.1
zx (npm) ^7.2.1
@semantic-release/commit-analyzer (npm) ^13.0.1
@semantic-release/github (npm) ^12.0.2
@semantic-release/npm (npm) ^13.1.3
@types/node (npm) ^18.15.3
@types/sinon (npm) ^10.0.13
@types/yargs (npm) ^17.0.22
cspell (npm) ^6.30.2
eslint (npm) ^8.36.0
eslint-config-canonical (npm) ^41.0.1
semantic-release (npm) ^25.0.2
sinon (npm) ^15.0.2
typescript (npm) ^5.0.2
vitest (npm) ^0.31.4
Files by Type (count)
TypeScript
31
JavaScript
5
YAML
4
JSON
4
Markdown
3
Other (no ext)
2
Git Ignore
1
Files by Type (size)
JSON
884KB
TypeScript
67KB
Markdown
28KB
YAML
2KB
Other (no ext)
1KB
JavaScript
792B
Git Ignore
82B

The LLM identified 2 files worth highlighting for reuse:

Implements robust process tree termination by first sending SIGTERM to all processes in the tree, then SIGKILL after a grace period if processes haven't exited. Handles edge cases like already-terminated processes and provides detailed logging. This component solves the non-trivial problem of reliably cleaning up child process hierarchies, which is essential for any application managing subprocesses. It could be extracted with minimal changes as it only depends on the 'find-process' and 'pidtree' packages plus a logger interface.

file: src/killPsTree.ts ↗ | tags: #process-management #graceful-shutdown #signal-handling

Evaluates a composable expression language inspired by Watchman, supporting logical operators (allof, anyof, not) and matching primitives (dirname, idirname, match, imatch) using micromatch for glob pattern matching. This implements a reusable predicate system for filtering file paths based on hierarchical and naming criteria. The recursive evaluation of expression trees demonstrates non-trivial functional programming principles. It could be easily extracted as it only depends on micromatch for matching logic and path for directory operations, with the Expression type being simple to replicate.

file: src/findNearestDirectory.ts ↗ | tags: #expression-evaluation #pattern-matching #functional-programming
Last analyzed: 2026-07-27 20:29:57.478708
Next check: 2026-08-03 20:29:57.474639
$ submit: