# diff-run

> run command after git merge

Latest version **1.1.1** (published 2022-04-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install diff-run
pnpm add diff-run
yarn add diff-run
bun add diff-run
```

Provides the command `diff-run`.

## 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.1.1 |
| Published | 2022-04-19 |
| First published | 2021-10-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >= 14.x |
| Dependencies | 11 |
| Unpacked size | 21.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | kagawagao |
| Maintainers | kagawa |
| Keywords | diff-run, diffrun, git, husky, hook, git-hook |

## Links

- npm: https://www.npmjs.com/package/diff-run
- Repository: https://github.com/kagawagao/diff-run
- Homepage: https://github.com/kagawagao/diff-run#readme
- Issues: https://github.com/kagawagao/diff-run/issues
- npm.io page: https://npm.io/package/diff-run

## Dependencies (11)

- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [debug](https://npm.io/package/debug.md) ^4.3.2
- [listr2](https://npm.io/package/listr2.md) ^4.0.0
- [signale](https://npm.io/package/signale.md) ^1.4.0
- [inquirer](https://npm.io/package/inquirer.md) ^8.2.0
- [commander](https://npm.io/package/commander.md) ^9.0.0
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.4
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^7.0.1
- [git-repo-info](https://npm.io/package/git-repo-info.md) ^2.1.1
- [command-exists](https://npm.io/package/command-exists.md) ^1.2.9
- [please-upgrade-node](https://npm.io/package/please-upgrade-node.md) ^3.2.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2022-04-19
- 1.1.0 — 2022-02-14
- 1.0.6 — 2022-02-08
- 1.0.5 — 2021-11-09
- 1.0.4 — 2021-10-19
- 1.0.3 — 2021-10-19
- 1.0.2 — 2021-10-19
- 1.0.1 — 2021-10-19
- 1.0.0 — 2021-10-19

## README

# Diff Run

> run command after file reversion change, use with `post-merge` hook

[![build](https://github.com/kagawagao/diff-run/actions/workflows/build.yml/badge.svg)](https://github.com/kagawagao/diff-run/actions/workflows/build.yml)
[![version](https://badgen.net/npm/v/diff-run)](https://www.npmjs.com/package/diff-run)
[![license](https://badgen.net/npm/license/diff-run)](https://www.npmjs.com/package/diff-run)
[![node](https://badgen.net/npm/node/diff-run)](https://www.npmjs.com/package/diff-run)

## Usage

### Install

```bash
npm i diff-run
```

### Use with [husky](https://github.com/typicode/husky)

- create `post-merge` in `husky` config directory
- add script into `post-merge`

```sh
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx diff-run
```

> FYI, add `--no-auto` flag will disable auto-run

## Config

support all configurations which support by [`cosmiconfig`](https://github.com/davidtheclark/cosmiconfig)

- `diffrun` in `package.json`

```json
{
  "diffrun": {
    "package-lock.json": "npm ci"
  }
}
```

- a JSON or YAML, extensionless "rc file", such as `.diffrunrc`

```json
{
  "package-lock.json": "npm ci"
}
```

- an "rc file" with the extensions .json, .yaml, .yml, .js, or .cjs, such as `diffrunrc.json`

```json
{
  "package-lock.json": "npm ci"
}
```

- a `diffrun.config.js` or `diffrun.config.cjs` CommonJS module

```javascript
module.exports = {
  'package-lock.json': ['npm ci'],
}
```

config in `Array` will be executed in order. Otherwise, it will be executed concurrently

- In Order

```javascript
// this will be executed in order
module.exports = [
  {
    'package.json': ['npm ci'],
  },
  {
    '.eslintrc.js': 'npx eslint .',
  },
]
```

- Concurrently

```javascript
// this will be executed concurrently
module.exports = {
  'package.json': ['npm ci'],
  '.eslintrc.js': 'npx eslint .',
}
```

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