{"id":19316246,"url":"https://github.com/userfrosting/gulp-prune","last_synced_at":"2025-04-12T13:09:06.343Z","repository":{"id":37961867,"uuid":"384592314","full_name":"userfrosting/gulp-prune","owner":"userfrosting","description":"Delete files that should not be in the destination directory","archived":false,"fork":false,"pushed_at":"2025-04-07T14:57:08.000Z","size":650,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T13:08:54.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/userfrosting.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":null,"patreon":null,"open_collective":"userfrosting","ko_fi":"lcharette","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2021-07-10T02:21:15.000Z","updated_at":"2025-04-07T14:56:23.000Z","dependencies_parsed_at":"2023-02-16T08:15:16.555Z","dependency_job_id":"4a7dbb0d-3bd5-4177-897b-29ba9e15b4a0","html_url":"https://github.com/userfrosting/gulp-prune","commit_stats":{"total_commits":244,"total_committers":5,"mean_commits":48.8,"dds":0.1885245901639344,"last_synced_commit":"3545dbc57e8cbe35ee680c673e467f74349a1ae4"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fgulp-prune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fgulp-prune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fgulp-prune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userfrosting%2Fgulp-prune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/userfrosting","download_url":"https://codeload.github.com/userfrosting/gulp-prune/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248571888,"owners_count":21126522,"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":[],"created_at":"2024-11-10T01:10:34.859Z","updated_at":"2025-04-12T13:09:06.302Z","avatar_url":"https://github.com/userfrosting.png","language":"JavaScript","funding_links":["https://opencollective.com/userfrosting","https://ko-fi.com/lcharette"],"categories":[],"sub_categories":[],"readme":"# gulp-prune\n\nA [Gulp](http://gulpjs.com/) plugin to delete files that should not be in the destination directory.\n\nFiles that have not been seen will be deleted after the stream is flushed.\n\n## Examples\n\n### Prune with 1:1 mapping\n\nThis example will delete all files in the target directory that do not match a source file,\nafter transpiling changed files.\n\n```js\nimport gulp from 'gulp';\nimport { prune } from 'gulp-prune';\nimport newer from 'gulp-newer';\nimport babel from 'gulp-babel';\n\nexport function build() {\n  return gulp.src('src/**/*.js')\n    .pipe(prune('build/'))\n    .pipe(newer('build/'))\n    .pipe(babel({ presets: [ 'es2015' ] }))\n    .pipe(gulp.dest('build/'));\n}\n```\n\n### Prune with custom mapping\n\nThe mapping can be customised if the source and destination file names are different.\n\nThis example will prune all .js and .js.map files that aren't from the source .ts files.\n\n```js\nimport gulp from 'gulp';\nimport { prune } from 'gulp-prune';\nimport newer from 'gulp-newer';\nimport sourcemaps from 'gulp-sourcemaps';\nimport typescript from 'gulp-typescript';\n\nexport function build() {\n  return gulp.src('src/**/*.ts')\n    .pipe(prune({ dest: 'build/', ext: [ '.js', '.js.map' ] }))\n    .pipe(newer({ dest: 'build/', ext: '.js' }))\n    .pipe(sourcemaps.init())\n    .pipe(typescript())\n    .pipe(sourcemaps.write('.'))\n    .pipe(gulp.dest('build/'));\n}\n```\n\n## API\n\n### Export\n\n- `prune(dest)`\n- `prune(dest, options)`\n- `prune(options)`\n\n### Options\n\n- `options.dest` (or `dest` argument)\n\n  The directory to prune files from.\n\n- `options.map`\n\n  A function that maps the source file name to what is expected in the `dest` directory.  The function may return a string\n  or array of string file names to keep.  Can't be used with options.ext.\n\n- `options.filter`\n\n  If a string, only files that match this [Minimatch](https://www.npmjs.com/package/minimatch) pattern may be pruned.\n\n  If a function, will be called with the relative path for each file to be pruned.  Return true to delete it.\n\n- `options.ext`\n\n  A convenience option to both map the extension and ensure only those extensions are deleted.\n  May be a single string or an array of strings.\n\n  e.g. `{ ext: [ '.js', '.js.map' ] }` is the equivalent of\n\n  ```js\n  {\n    map: (name) =\u003e [\n      name.replace(/(\\.[^./\\\\]*)?$/, '.js'),\n      name.replace(/(\\.[^./\\\\]*)?$/, '.js.map')\n    ],\n    filter: '**/*.@(js|js.map)'\n  }\n  ```\n\n- `options.verbose`\n\n  Set to true to log all deleted files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserfrosting%2Fgulp-prune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuserfrosting%2Fgulp-prune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserfrosting%2Fgulp-prune/lists"}