Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>File Watcher-ProdNew to Visual Studio Code? Get it now.
File Watcher-Prod

File Watcher-Prod

Ally publish

|
147 installs
| (0) | Free
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillu
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

The "Exploratory Testing" extension is now "Test & Feedback" and is now Generally Available.

https://github
  • This is a bulleted list with bold and italics and
  • Bullet list two
  1. Numbered list element 1
  2. Numbered list element 2
  3. Numbered list element with another level
  • This is the first level of this list.
    • To make a second level, add two spaces before the asterisk or number.

Heading level one (with a space after the #)

Heading level two

Heading level three

Block quotes have to start and end with a blank line

And each line of the quote starts with a right angle bracket and a space

Here is some inline code.

This is a code block.

Marketplace homepage

Horizontal Line:


Line 1

Line 2

  • Mail link:: [Mail us](mailto: abc@def.com)

File & Folder Watcher

This extension allows configuring commands that get run whenever a file is saved or folder is changed in vscode.

Features

  • Following two events: onSaveDocument and onFolderChange:
    • onFileChange - allows to track changes to the contents of an existing file
    • onFolderChange - allows to track the deletion, addition and modification of files
  • case insensitive workspace root folder
  • Configure multiple commands that run when the event happened
  • Regex pattern matching for files that trigger commands running
  • Sync and async support

Configuration

Add "filewatcher" configuration to user or workspace settings.

  • "shell" - (optional) shell path to be used with child_process.exec options that runs commands.
  • "autoClearConsole" - (optional) clear VSCode output console every time commands run. Defaults to false.
  • "commands" - array of commands that will be run whenever a file is saved.
    • "match" - a regex for matching which files to run commands on.
    • "notMatch" - a regex for matching files not to run commands on.

    NOTE Since this is a Regex, and also in a JSON string backslashes have to be double escaped such as when targetting folders. e.g. "match": "some\\folder\\.*"

    • "cmd" - command to run. Can include parameters that will be replaced at runtime (see Placeholder Tokens section below).
    • "isAsync" (optional) - defaults to false. If true, next command will be run before this one finishes.

Placeholder Tokens

Commands support placeholders similar to tasks.json.

  • ${workspaceRoot}: case insensitive workspace root folder
  • ${file}: path of saved file
  • ${fileBasename}: saved file's basename
  • ${fileDirname}: directory name of saved file
  • ${fileExtname}: extension (including .) of saved file
  • ${fileBasenameNoExt}: saved file's basename without extension

Samples

File content change tracking example. Configuration in .vscode\settings.json

{
	"filewatcher.commands": [
		{
			"match": "\\.ts*",
			"isAsync": true,
			"cmd": "echo '${file} file content Changed'",
			"event": "onFileChange"
		}		
	]
}

 screencast

Folder content change tracking example. Configuration in .vscode\settings.json

{
	"filewatcher.commands": [
		{
			"match": "\\.*",
			"isAsync": true,
			"cmd": "echo '${file} folder content Changed'",
			"event": "onFolderChange"
		}		
	]
}

 screencast

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft