{"id":19560629,"url":"https://github.com/zoubin/clean-remains","last_synced_at":"2026-06-10T02:31:29.993Z","repository":{"id":57147236,"uuid":"52585253","full_name":"zoubin/clean-remains","owner":"zoubin","description":"Remove files created in the last run but not anymore in the next","archived":false,"fork":false,"pushed_at":"2016-02-26T10:33:42.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-20T02:17:02.213Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/zoubin.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}},"created_at":"2016-02-26T07:00:37.000Z","updated_at":"2016-02-26T10:34:28.000Z","dependencies_parsed_at":"2022-09-06T13:02:25.596Z","dependency_job_id":null,"html_url":"https://github.com/zoubin/clean-remains","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zoubin/clean-remains","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fclean-remains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fclean-remains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fclean-remains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fclean-remains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoubin","download_url":"https://codeload.github.com/zoubin/clean-remains/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoubin%2Fclean-remains/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34134633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11T05:08:18.752Z","updated_at":"2026-06-10T02:31:29.969Z","avatar_url":"https://github.com/zoubin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# clean-remains\n[![version](https://img.shields.io/npm/v/clean-remains.svg)](https://www.npmjs.org/package/clean-remains)\n[![status](https://travis-ci.org/zoubin/clean-remains.svg)](https://travis-ci.org/zoubin/clean-remains)\n![node](https://img.shields.io/node/v/clean-remains.svg)\n\nRemove files created in the last run but not anymore in the current one.\n\nIn development environment, build process runs once a file change detected.\nIf a file is removed, the corresponding compiled file (like a browserify bundle) remains,\nwhich is redundant and should be deleted.\n\n## Example\n\nThe following example make the `'build'` directory always has the same contents with the `'src'` directory.\n\n```javascript\nconst gulp = require('gulp')\nconst clean = require('clean-remains').glob('build/*.js')\n\ngulp.task('sync', function () {\n  return gulp.src('src/*.js')\n    .pipe(gulp.dest('build'))\n    .pipe(clean())\n    .once('delete', files =\u003e console.log(files))\n})\n\ngulp.task('watch', ['sync'], function () {\n  gulp.watch('src/*.js', ['sync'])\n})\n\n```\n\nYou could delete the whole `'build'` directory in the example above.\nHowever, if you do that and there are also css files in the `'build'` directory,\nthey will be deleted against your will.\n\n## API\n```javascript\nconst Clean = require('clean-remains')\n\n```\n\n### clean = Clean(initialFiles)\nReturn a function like a gulp plugin,\nwhich should be used after `gulp.dest`.\n\n**initialFiles**\n\nType: `Array`\n\nRequired.\n\nIf there are no redundant files before the first run,\nyou could pass an empty array.\n\n```javascript\nconst gulp = require('gulp')\nconst clean = require('clean-remains')([])\n\n```\n\n### clean = Clean.glob(patterns, opts)\n\n`patterns` and `opts` are passed to [`globby`] to create the `initialFiles`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fclean-remains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoubin%2Fclean-remains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoubin%2Fclean-remains/lists"}