# createFileWatcher()

[**PromptScript API**](https://getpromptscript.dev/api-reference/index.md)

***

# Function: createFileWatcher()

> **createFileWatcher**(`workspace`, `watchPaths`, `onEvent`): `FSWatcher`

Defined in: [server/src/watcher.ts:17](https://github.com/mrwogu/promptscript/blob/49aa50f943865b985366c4eda6e95c5a31ef39a6/packages/server/src/watcher.ts#L17)

## Parameters

### workspace

`string`

### watchPaths

`string`[]

### onEvent

(`event`) => `void`

## Returns

`FSWatcher`