
Security News
gem.coop Tests Dependency Cooldowns as Package Ecosystems Move to Slow Down Attacks
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.
Detects when a new file is different than an existing file and prompts the user for action.
Detects when a new file is different than an existing file and prompts the user for action.
Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.
Install with npm:
$ npm install --save conflicts
const Conflicts = require('conflicts');
const conflicts = new Conflicts();
Create an instance of Conflicts with the given options and optional Vinyl constructor.
Params
options {Object}File {Function}: Optionally pass a vinyl contructor, otherwise the default File class is used.returns {Conflicts}: Returns an instance of Conflicts.Example
const Conflicts = require('conflicts');
const conflicts = new Conflicts({}, require('vinyl'));
Compares an existing (old) file to a new proposed file, then prompts for an action if the files are not equal. If the contents of both files is identical, no action is taken, otherwise you will be prompted to choose the action to take. See the unit tests for examples of how to skip prompts.
Params
proposedFile {Object}: New file.existingFile {Object}: Existing file.options {Object}returns {Promise}: Returns a promise with the action that was taken.Example
conflicts.detect(fileA, fileB)
.then(action => console.log('Action taken:', action))
.catch(console.error)
Same as .detect, except the second argument is a string to an existing file on the file system.
Params
proposed {Object}: New file.existingPath {Object}: File path to existing file.options {Object}returns {Promise}: Returns a promise with the action that was taken.Example
conflicts.detectFile(file, 'path/to/file.txt')
.then(action => console.log('Action taken:', action))
.catch(console.error)
Runs detect on an array of "proposed" files.
Params
files {Array}: Array of file objects.options {Object}returns {Array}
Example
conflicts.files([fileA, fileB, fileC])
.then(action => console.log('Action taken:', action))
.catch(console.error)
Takes an array of "proposed" files, and returns an array of strings, where each string represents a diff of the proposed file's contents versus an existing file's contents.
Params
files {Array}options {Object}returns {Array}Example
conflicts.diffFiles([fileA, fileB, fileC])
.then(diffs => {
diffs.forEach(diff => console.log(diff));
})
.catch(console.error)
Returns true if an fileA (existing/old) file appears to be identical to a fileB (proposed/new) file.
Params
proposed {Object}: vinyl file representing a proposed (new) fileexisting {Object}: vinyl file representing an existing (old) fileoptions {Object}returns {Boolean}Example
console.log(conflicts.isEqual(fileA, fileB));
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for advice on opening issues, pull requests, and coding standards.
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Jon Schlinkert
Copyright © 2018, Jon Schlinkert. Released under the MIT License.
This file was generated by verb-generate-readme, v0.8.0, on November 22, 2018.
FAQs
Detects when a new file is different than an existing file and prompts the user for action.
The npm package conflicts receives a total of 2 weekly downloads. As such, conflicts popularity was classified as not popular.
We found that conflicts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.