Use Chokidar to watch for specific file extension

后端 未结 1 1526
陌清茗
陌清茗 2021-01-18 19:30

I am looking to watch a folder using the nodejs Chokidar I only want to monitor for additions, deletes of xml files. I am new to Chokidar and can\'t figure it out. I tried s

相关标签:
1条回答
  • 2021-01-18 20:02

    chokidar accepts a glob pattern as first argument.
    You can use it match your XML files.

    chokidar.watch("some/directory/**/*.xml", config)
    
    0 讨论(0)
提交回复
热议问题