# detect-conflict

> Small utility library that check if a new file content can be merged safely in the on-disk existing file.

Latest version **1.0.1** (published 2016-07-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install detect-conflict
pnpm add detect-conflict
yarn add detect-conflict
bun add detect-conflict
```

## 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.0.1 |
| Published | 2016-07-04 |
| First published | 2014-11-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Simon Boudrias |
| Maintainers | sboudrias |

## Links

- npm: https://www.npmjs.com/package/detect-conflict
- Repository: https://github.com/SBoudrias/detect-conflict
- Issues: https://github.com/SBoudrias/detect-conflict/issues
- npm.io page: https://npm.io/package/detect-conflict

## Recent versions

- 1.0.1 (latest) — 2016-07-04
- 1.0.0 — 2014-11-02

## README

detect-conflict
=================

Small utility library that check if a new file content can be merged safely in the on-disk existing file.

## Usage

### Example
```js
import conflict from 'detect-conflict';

const isConflicting = conflict('some-file-name.js', 'var newContent;');
```

It'll return `true` if a conflict is found, `false` otherwise.

### API

#### `conflict(filepath : string, contents : Buffer | String)`

If the `contents` is passed as a string, we assume it is utf8 encoded. Pass a `Buffer` if you want to compare special encoding.

If `filepath` points to a directory, we'll always return `true`.

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