https://github.com/samthor/sents-cli
Command-line filesystem watcher with low dependencies
https://github.com/samthor/sents-cli
filesystem nodejs watch
Last synced: about 2 months ago
JSON representation
Command-line filesystem watcher with low dependencies
- Host: GitHub
- URL: https://github.com/samthor/sents-cli
- Owner: samthor
- Created: 2020-11-30T01:00:31.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-07-31T01:52:34.000Z (almost 5 years ago)
- Last Synced: 2025-02-19T02:49:51.698Z (over 1 year ago)
- Topics: filesystem, nodejs, watch
- Language: JavaScript
- Homepage:
- Size: 47.9 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Command-line filesystem watcher, useful for running commands when something changes.
Has only three direct dependencies and uses no native code!
⚠️ This uses [sents](https://www.npmjs.com/package/sents) under the hood, which is a fast watcher with zero dependencies and no native code.
Try it out if you'd like even fewer dependencies!
# Usage
```bash
npm install sents-cli
# for info on command-line args
sents --help
# to print all CSS files that have changed
sents "foo/**/*.css"
# to print everything in a folder
sents "path/to/folder"
# to rebuild JS after any file changes, deduped to every second
sents "**/*.js" -c "rollup" -d 1000
```
# Notes
- This doesn't support polling, so don't use it on network filesystems, but you shouldn't really be doing interactive dev work from there anyway
- You can't exclude files from this right now, so it might watch your whole `node_modules` folder
# Dependencies
All of these dependencies have zero further dependencies.
Therefore, using this package will add at most three dependencies to your project.
- `mri`: for parsing arguments
- `picomatch`: for supporting glob syntax
- `sents`: the underlying watcher library