detect-conflict
Small utility library that check if a new file content can be merged safely in the on-disk existing file.
Last updated 9 years ago by sboudrias .
MIT · Repository · Bugs · Original npm
$ cnpm install detect-conflict 
SYNC missed versions from official npm registry.

detect-conflict Build Status

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.

Current Tags

  • 1.0.1                                ...           latest (9 years ago)

1 Versions

  • 1.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org