# print-diff

> Prints a pretty diff of two strings.

Latest version **2.0.0** (published 2023-01-06) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-01-06 |
| First published | 2015-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | ^14.18.0 \|\| ^16.14.0 \|\| >=18.0.0 |
| Dependencies | 1 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Maintainers | linusu |

## Links

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

## Dependencies (1)

- [diff](https://npm.io/package/diff.md) ^5.1.0

## Recent versions

- 2.0.0 (latest) — 2023-01-06
- 1.0.0 — 2019-11-16
- 0.1.1 — 2018-07-11
- 0.1.0 — 2015-01-06

## README

# print-diff

Prints a pretty diff of two strings.

## Installation

```sh
npm install --save print-diff
```

## Usage

```javascript
import { printUnifiedDiff } from 'print-diff'

printUnifiedDiff('Hello\nLinus', 'Hello\nworld')
```

![Output](/example-unified.png?raw=true)

---

```javascript
import { printInlineDiff } from 'print-diff'

printInlineDiff('The quick pink fox', 'The quick brown fox')
```

![Output](/example-inline.png?raw=true)

## API

### `printUnifiedDiff(actual, expected[, out])`

Prints a unified diff.

### `printInlineDiff(actual, expected[, out])`

Prints an inline diff.

## License

MIT

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