detect-conflict ![Build Status](https://camo.githubusercontent.com/ffd3e43c558eeef82c4accb6060ca2a06178ca0b715a6f004dacdf66930c42b4/68747470733a2f2f7472617669732d63692e6f72672f53426f7564726961732f6465746563742d636f6e666c6963742e7376673f6272616e63683d6d6173746572)
Small utility library that check if a new file content can be merged safely in the on-disk existing file.
Usage
Example
var conflict = require('detect-conflict');
var 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
.