Event on file created in the project


#1

Currently I can detect when a new file is created by using onDidAddTextEditor, since a new file will be opened in a text editor - I’m therefore able to catch the new file and do whatever I need to.

Problem is, I’m dealing with a plugin that allows me to create a directory with multiple files at once, so I don’t really think the best option would be to force all the created files to be opened.

Is there any event I could subscribe to in order to catch new files creation in my project?
I’m just asking, after reading this I don’t think there is any.

Cheers.


Project event for file changes
#2

You can use a node module like chokidar to watch a directory for new files


#3

Thank you very much, I’ll check this out.