# cpdiff

> File difference tool for competitive programming.

Latest version **1.1.0** (published 2024-10-21) · ISC license · 0 weekly downloads

## Install

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

Provides the command `cpdiff`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2024-10-21 |
| First published | 2021-11-01 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 108 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | felovilches |

## Links

- npm: https://www.npmjs.com/package/cpdiff
- npm.io page: https://npm.io/package/cpdiff

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2

## Recent versions

- 1.1.0 (latest) — 2024-10-21
- 1.0.8 — 2021-11-08
- 1.0.7 — 2021-11-08
- 1.0.6 — 2021-11-02
- 1.0.5 — 2021-11-02
- 1.0.4 — 2021-11-02
- 1.0.2 — 2021-11-02
- 1.0.1 — 2021-11-02
- 1.0.0 — 2021-11-01

## README

# cpdiff

**IMPORTANT**

The project was moved (and rewritten in Go) to:

https://github.com/ChrisVilches/cpdiff

------


Install using (globally since it's a CLI application):

```bash
npm install -g cpdiff
```

Compare your program's output to the accepted answer:

```bash
./your_program < data.in | cpdiff data.out
```

<p align="center">
  <img src="cpdiff.jpg" width="700"/>
</p>

## About

This is a simple utility for comparing the output of your program to the accepted answer or sample output. The name stands for *competitive programming difference*.

This program was developed because programs like `sdiff` or `diff` completely deform the layout when there are too many differences. This tool is meant to be specific for competitive programming.

## Usage

Compare two files:

```bash
cpdiff file1 file2
```

Specify only one file, but pass the output of some other program as input (stdin).

```bash
some_program | cpdiff file1
```

Use `-` (dash) to specify which side of the comparison should receive input from stdin.

```bash
cpdiff - file1
# or
cpdiff file1 -
```

## More competitive programming tools

### C++ Runner

Try my [C++ runner](https://gist.github.com/ChrisVilches/5f251851e93e45bc9941aa94ec13973d). I use this program to quickly run C++ files as if they were scripts, using the simple `c++ my_program.cpp` command.

### Kattis Scraper

Scrapes the entire Kattis website, downloads all problems and helps you perform complex queries to find interesting problems.

https://github.com/ChrisVilches/Kattis-Scraper

## Contribution

Feature requests, issues, bug reports, pull requests are welcome.

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