# watch-then-execute

> A CLI tool to execute script after source file changes.

Latest version **1.2.0** (published 2020-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install watch-then-execute
pnpm add watch-then-execute
yarn add watch-then-execute
bun add watch-then-execute
```

Provides the command `watch-then-execute`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2020-06-22 |
| First published | 2017-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | York Yao |
| Maintainers | plantain_00 |

## Links

- npm: https://www.npmjs.com/package/watch-then-execute
- Repository: https://github.com/plantain-00/watch-then-execute
- Homepage: https://github.com/plantain-00/watch-then-execute#readme
- Issues: https://github.com/plantain-00/watch-then-execute/issues
- npm.io page: https://npm.io/package/watch-then-execute

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) 4
- [chokidar](https://npm.io/package/chokidar.md) 3
- [minimist](https://npm.io/package/minimist.md) 1

## Recent versions

- 1.2.0 (latest) — 2020-06-22
- 1.1.4 — 2020-05-16
- 1.1.3 — 2020-05-01
- 1.1.2 — 2020-03-14
- 1.1.1 — 2017-10-31
- 1.1.0 — 2017-10-31
- 1.0.2 — 2017-09-19
- 1.0.1 — 2017-08-31
- 1.0.0 — 2017-08-10

## README

# watch-then-execute

[![Dependency Status](https://david-dm.org/plantain-00/watch-then-execute.svg)](https://david-dm.org/plantain-00/watch-then-execute)
[![devDependency Status](https://david-dm.org/plantain-00/watch-then-execute/dev-status.svg)](https://david-dm.org/plantain-00/watch-then-execute#info=devDependencies)
[![Build Status: Linux](https://travis-ci.org/plantain-00/watch-then-execute.svg?branch=master)](https://travis-ci.org/plantain-00/watch-then-execute)
[![Build Status: Windows](https://ci.appveyor.com/api/projects/status/github/plantain-00/watch-then-execute?branch=master&svg=true)](https://ci.appveyor.com/project/plantain-00/watch-then-execute/branch/master)
[![npm version](https://badge.fury.io/js/watch-then-execute.svg)](https://badge.fury.io/js/watch-then-execute)
[![Downloads](https://img.shields.io/npm/dm/watch-then-execute.svg)](https://www.npmjs.com/package/watch-then-execute)
[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fplantain-00%2Fwatch-then-execute%2Fmaster%2Fpackage.json)](https://github.com/plantain-00/watch-then-execute)

A CLI tool to execute script after source file changes.

## install

`yarn global add watch-then-execute`

## usage

`watch-then-execute "src/*.ts" --script "npm run build"`

## options

key | description
--- | ---
-e,--exclude | exclude files, repeatable
--script | executed script
-h,--help | Print this message.
-v,--version | Print the version

## API

```ts
import { watch } from "watch-then-execute";

watch(["src/*.ts"], [], "npm run build");
watch(["src/*.ts"], ["src/*.d.ts"], "npm run build");
```

### exclude files

`watch-then-execute "src/*.ts" --exclude "src/*.d.ts" --script "npm run build"`

---
_Source: https://npm.io/package/watch-then-execute · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
