Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃摑 elaborate further on initial add events triggering #368

Closed
wants to merge 1 commit into from

Conversation

basarat
Copy link
Contributor

@basarat basarat commented Oct 16, 2015

Not sure if this is by design or a bug. If its by design would be good to have this in the documentation. Otherwise I can create a bug 馃尮

@es128
Copy link
Collaborator

es128 commented Oct 16, 2015

I don't understand the point you're trying to make with this change.

ignoreInitial has little to do with when files are added to disk. The point is that by default add events are emitted for all the files that are already there. This can be useful for knowing what's on disk being watched without having to separately use node-glob or something like that. Setting ignoreInitial: true suppresses that behavior if you don't care what the file tree looks like when watching starts.

@es128
Copy link
Collaborator

es128 commented Oct 16, 2015

Closing for now, but we can discuss further.

@es128 es128 closed this Oct 16, 2015
@basarat basarat deleted the patch-1 branch October 16, 2015 18:02
@basarat
Copy link
Contributor Author

basarat commented Oct 16, 2015

The point is that by default add events are emitted for all the files that are already there

I thought add events were about the inverse of unlink events ... i.e. a new file is added. I got that impression because of how they are listed (https://github.com/paulmillr/chokidar#getting-started) :

image

Question : Is there an event that gets emitted when a file is added to disk?

Thanks for the clarification. I'll try and write something up 馃尮

@paulmillr
Copy link
Owner

Is there an event that gets emitted when a file is added to disk

That's add when ignoreInitial is `true.

@es128
Copy link
Collaborator

es128 commented Oct 16, 2015

also after the ready event has been emitted regardless of the ignoreInitial setting, any add events represent a file newly written to disk

@es128
Copy link
Collaborator

es128 commented Oct 16, 2015

946ae86 hopefully makes it clearer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants