Files
test-repo/docs/watching-files.md
T

18 lines
440 B
Markdown
Raw Normal View History

2017-11-07 14:39:07 +11:00
---
id: watching-files
title: Watching For Changes
---
If you prefer to have prettier watch for changes from the command line you can use a package like [onchange](https://www.npmjs.com/package/onchange). For example:
```
npx onchange '**/*.js' -- npx prettier --write {{changed}}
```
or add the following to your `package.json`
```json
"scripts": {
"prettier-watch": "onchange '**/*.js' -- prettier --write {{changed}}"
},
```