{"id":15732653,"url":"https://github.com/jonschlinkert/gulp-conflicts","last_synced_at":"2025-03-13T05:31:11.680Z","repository":{"id":65990692,"uuid":"158676060","full_name":"jonschlinkert/gulp-conflicts","owner":"jonschlinkert","description":"Detects when a file to be written is different than an existing file and, if necessary, prompts the user for action.","archived":false,"fork":false,"pushed_at":"2018-11-22T09:42:35.000Z","size":393,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T18:56:54.698Z","etag":null,"topics":["conflict","conflicts","detect","files","gulp","gulpplugin","javascript","node","nodejs","prompt","stream","through"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonschlinkert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-22T09:41:55.000Z","updated_at":"2024-01-09T10:24:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"608de6f1-942c-42e7-83ab-268717eefc54","html_url":"https://github.com/jonschlinkert/gulp-conflicts","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-conflicts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-conflicts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-conflicts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fgulp-conflicts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/gulp-conflicts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243351159,"owners_count":20276894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conflict","conflicts","detect","files","gulp","gulpplugin","javascript","node","nodejs","prompt","stream","through"],"created_at":"2024-10-04T00:21:30.602Z","updated_at":"2025-03-13T05:31:11.324Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gulp-conflicts [![NPM version](https://img.shields.io/npm/v/gulp-conflicts.svg?style=flat)](https://www.npmjs.com/package/gulp-conflicts) [![NPM monthly downloads](https://img.shields.io/npm/dm/gulp-conflicts.svg?style=flat)](https://npmjs.org/package/gulp-conflicts) [![NPM total downloads](https://img.shields.io/npm/dt/gulp-conflicts.svg?style=flat)](https://npmjs.org/package/gulp-conflicts) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/gulp-conflicts.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/gulp-conflicts)\n\n\u003e Detects when a (new) vinyl file is different than an existing file on the file system, and either prompts the user for action, skips the file, or calls a function on the file to determine the action to take.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save gulp-conflicts\n```\n\n## Usage\n\nPass the same destination value (string or function) to the `conflicts()` plugin that you pass to `gulp.dest()`. This is necessary so the plugin can check for existing files that may conflict with (proposed) files before they are written.\n\n```js\nconst conflicts = require('gulp-conflicts');\nconst gulp = require('gulp');\n\ngulp.task('default', () =\u003e {\n  let dest = file =\u003e path.join(file.base, 'foo');\n\n  return gulp.src('*.js')\n    .pipe(conflicts(dest))\n    .pipe(gulp.dest(dest));\n});\n```\n\n## File detection\n\n1. The existing file's contents is compared with `file.contents` on the vinyl file\n2. If the contents of both are identical, no action is taken, the file is skipped\n3. If the contents differ, the user is prompted for action\n4. If no conflicting file exists, the vinyl file is written to the file system\n\n**Params**\n\n* `dest` **{String}**: The same desination directory passed to `app.dest()`\n* `returns` **{String}**\n\n**Example**\n\n```js\napp.src('foo/*.js')\n  .pipe(conflicts('foo'))\n  .pipe(app.dest('foo'));\n```\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning 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:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on November 22, 2018._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgulp-conflicts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fgulp-conflicts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fgulp-conflicts/lists"}