# postmon

> An npm script that runs another script only if the contents of a directory have changed

Latest version **0.2.2** (published 2023-04-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install postmon
pnpm add postmon
yarn add postmon
bun add postmon
```

Provides the command `postmon`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2023-04-17 |
| First published | 2021-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 9 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | binary64 |
| Maintainers | binary64 |

## Links

- npm: https://www.npmjs.com/package/postmon
- Repository: https://github.com/binary64/postmon
- Issues: https://github.com/binary64/postmon/issues
- npm.io page: https://npm.io/package/postmon

## Dependencies (9)

- [puka](https://npm.io/package/puka.md) 1.0.1
- [hasha](https://npm.io/package/hasha.md) 5.2.2
- [p-map](https://npm.io/package/p-map.md) 5.5.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [packito](https://npm.io/package/packito.md) ^0.5.0
- [fs-extra](https://npm.io/package/fs-extra.md) 11.1.1
- [hash-obj](https://npm.io/package/hash-obj.md) 4.0.0
- [commander](https://npm.io/package/commander.md) 10.0.1
- [fast-glob](https://npm.io/package/fast-glob.md) 3.2.12

## Recent versions

- 0.2.2 (latest) — 2023-04-17
- 0.2.1 — 2023-04-17
- 0.2.0 — 2021-08-26
- 0.1.1 — 2021-08-12
- 0.1.0 — 2021-08-08
- 0.0.6 — 2021-08-07
- 0.0.5 — 2021-08-07
- 0.0.4 — 2021-08-07

## README

# postmon

An npm script that runs another script only if the contents of a directory have changed

## Quickstart

Install to devDependencies

```bash
pnpm add -D https://github.com/binary64/postmon
# or if you like to wait some more, and you use yarn:
yarn add -D https://github.com/binary64/postmon
# or if you like to wait some more even, and you use npm:
npm i -D https://github.com/binary64/postmon
```

Add to your `.gitignore`

```bash
printf "\n.postmon-lock\n" > .gitignore
```

Add to your `package.json` > `"scripts"` > `"post*"` section

```json
{
  "scripts": {
    "postinstall": "postmon --include \"src/**/*.ts\" echo \"Changes detected in your files\""
  }
}
```

## Advanced Configuration

You can add a `.postmon.yml` file to your repo, which describes the graph of code generations to be run. To invoke using this file, simple call `postmon` with no arguments:

```json
{
  "scripts": {
    "postinstall": "postmon"
  }
}
```

The format of `.postmon.yml` is as follows:

```yml
scripts:
  <name>:
    inputs:
      - <file glob>
    outputs:
      - <file glob>
    command: <shell command line>
  ...
```

And example can be found in `examples/prisma-nexus/.postmon.yml`.


## Contributing

To install for development, check out this repo and do `pnpm i && pnpm dev` - then in another terminal you can repeatedly do a `node dist/cli.mjs`

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