Comments (5)
Supporting globs sounds like a great addition to this library, not entirely sure how much work this will be.
The file change querying is already possible let events = await watcher.getEventsSince(dirPath, snapshotPath);
?
from watcher.
I'm curious, what would you use this for?
from watcher.
I would have a variety of use cases, but mainly standalone code generation tools and standalone non-web programming language compilers.
This library has a lot of appeal compared to other Node.js file watchers. I'm looking at using this as an alternative to using Watchman directly, thereby eliminating a hard requirement for end users (but still allowing for progressive enhancement if they already use it).
So I'd probably want to query the file system for specifically relevant files (probably via glob or file extension) upon cold start (changed since an arbitrary time, regardless of if an existing snapshot exists), then listen for change events if operating in watch-compile mode.
It is definitely understandable if you'd rather not have this be a general-purpose, fully featured watcher. But I think would potentially fill a really nice niche outside of just Parcel specifically.
from watcher.
watch only specific kinds of files (i.e.
*.css
)
You could try filespy
, a wrapper for @parcel/watcher
.
https://github.com/alloc/filespy
from watcher.
- query/watch only specific kinds of files (i.e.
*.css
)
I vote for this idea especially for Backend Integration like PHP, Ruby, etc.
Currently, I create a WordPress theme integrate with ViteJS with purpose to refresh the page on the browser (without user action) with PHP file extension if I do actions like create, edit, move, and delete in PHP file. So far I know, to support this capabilities developers tend to use chokidar wrapped with vite-plugin (e.g. : ElMassimo/vite-plugin-full-reload and arnoson/vite-plugin-live-reload) because chokidar can also watch file, glob, and array beside of dir.
I wish if @parcel/watcher can support these capabilities too.
Maybe we can add more flexibility in first parameter like await watcher.subscribe(‘file, dir, glob, array’, (err, status) => {})
instead of await watcher.subscribe(process.cwd(), (err, status) => {})
.
from watcher.
Related Issues (20)
- Separate packages for precompiled binaries HOT 1
- @parcel/watcher not working with Docker node:alpine image HOT 3
- Watcher not reporting events when used in docker. HOT 2
- npm ci cannot locate a prebuild for any given architecture HOT 3
- Error: No prebuild or local build of @parcel/watcher found. Tried @parcel/watcher-linux-arm64-musl. HOT 14
- v2.2.0 node-gyp rebuild error, incorrect scripts in npm registry HOT 11
- Specifying path to `watchman` executable HOT 1
- When using Watchman on Windows, a console window pops up when subscribing HOT 1
- gyp: binding.gyp not found (...) while trying to load binding.gyp HOT 33
- error when use node v18.18 on github runner images
- InotifyBackend hungs forever when inotify_init1 returns error HOT 1
- AWS Amplify build error HOT 2
- Github M1 Build Error sh: node-gyp-build: command not found HOT 1
- Change event is not emitted on Windows when continuously appending to an initially existing file
- when moving folder to a watched folder , only event for the moved folder is generated and not for files inside the folder
- Support for negated Ignores Globs
- node-addon-api should be a dev dependency? HOT 1
- With Watchman installed on Windows subscribe hangs
- Segmentation fault using wildcard in ignore option on Node.js v20.12.x (LTS) HOT 6
- FSEvents behaves differently compared to inotify with glob excludes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watcher.