{"id":13398058,"url":"https://github.com/sindresorhus/gulp-rev","last_synced_at":"2026-10-19T12:40:29.619Z","repository":{"id":12540559,"uuid":"15210616","full_name":"sindresorhus/gulp-rev","owner":"sindresorhus","description":"Static asset revisioning by appending content hash to filenames: `unicorn.css` → `unicorn-d41d8cd98f.css`","archived":false,"fork":false,"pushed_at":"2026-09-18T19:07:17.000Z","size":132,"stargazers_count":1535,"open_issues_count":16,"forks_count":209,"subscribers_count":27,"default_branch":"main","last_synced_at":"2026-09-25T02:38:33.637Z","etag":null,"topics":["gulp-plugin","hash","javascript","manifest","nodejs","rev"],"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/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":".github/contributing.md","funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2013-12-15T20:56:05.000Z","updated_at":"2026-09-18T19:07:21.000Z","dependencies_parsed_at":"2024-02-16T11:08:29.676Z","dependency_job_id":"36d8c271-97d3-4b1e-8762-631fe0d2b0ac","html_url":"https://github.com/sindresorhus/gulp-rev","commit_stats":{"total_commits":134,"total_committers":39,"mean_commits":"3.4358974358974357","dds":0.4029850746268657,"last_synced_commit":"1e20ee1da01379dcf18f98ff4932da7cdcb38cd4"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/sindresorhus/gulp-rev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-rev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-rev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-rev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-rev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/gulp-rev/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fgulp-rev/sbom","scorecard":{"id":826390,"data":{"date":"2025-08-11","repo":{"name":"github.com/sindresorhus/gulp-rev","commit":"1e20ee1da01379dcf18f98ff4932da7cdcb38cd4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Code-Review","score":3,"reason":"Found 11/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/gulp-rev/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/gulp-rev/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: .github/security.md:1","Info: Found linked content: .github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1","Info: Found text in security policy: .github/security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T16:42:48.408Z","repository_id":12540559,"created_at":"2025-08-23T16:42:48.408Z","updated_at":"2025-08-23T16:42:48.408Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343072799,"owners_count":37985889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"ssl_error","status_checked_at":"2026-10-03T21:59:58.217Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["gulp-plugin","hash","javascript","manifest","nodejs","rev"],"created_at":"2024-07-30T18:02:04.427Z","updated_at":"2026-10-19T12:40:29.367Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Plugins","插件"],"sub_categories":["Miscellaneous Plugins","其他插件"],"readme":"# gulp-rev\n\n\u003e Static asset revisioning by appending content hash to filenames\n\u003e `unicorn.css` → `unicorn-d41d8cd98f.css`\n\n**This project is feature complete. PRs adding new features will not be accepted.**\n\nMake sure to set the files to [never expire](http://developer.yahoo.com/performance/rules.html#expires) for this to have an effect.\n\n## Install\n\n```sh\nnpm install --save-dev gulp-rev\n```\n\n## Usage\n\n```js\nimport gulp from 'gulp';\nimport rev from 'gulp-rev';\n\nexport default () =\u003e (\n\tgulp.src('src/*.css')\n\t\t.pipe(rev())\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n## API\n\n### rev()\n\n### rev.manifest(path?, options?)\n\n#### path\n\nType: `string`\\\nDefault: `'rev-manifest.json'`\n\nManifest file path.\n\n#### options\n\nType: `object`\n\n##### base\n\nType: `string`\\\nDefault: `process.cwd()`\n\nOverride the `base` of the manifest file.\n\n##### cwd\n\nType: `string`\\\nDefault: `process.cwd()`\n\nOverride the current working directory of the manifest file.\n\n##### merge\n\nType: `boolean`\\\nDefault: `false`\n\nMerge existing manifest file.\n\n##### transformer\n\nType: `object`\\\nDefault: `JSON`\n\nAn object with `parse` and `stringify` methods. This can be used to provide a\ncustom transformer instead of the default `JSON` for the manifest file.\n\n### Original path\n\nOriginal file paths are stored at `file.revOrigPath`. This could come in handy for things like rewriting references to the assets.\n\n### Asset hash\n\nThe hash of each rev'd file is stored at `file.revHash`. You can use this for customizing the file renaming, or for building different manifest formats.\n\n### Asset manifest\n\n```js\nimport gulp from 'gulp';\nimport rev from 'gulp-rev';\n\nexport default () =\u003e (\n\t// By default, Gulp would pick `assets/css` as the base,\n\t// so we need to set it explicitly:\n\tgulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})\n\t\t.pipe(gulp.dest('build/assets'))  // Copy original assets to build dir\n\t\t.pipe(rev())\n\t\t.pipe(gulp.dest('build/assets'))  // Write rev'd assets to build dir\n\t\t.pipe(rev.manifest())\n\t\t.pipe(gulp.dest('build/assets'))  // Write manifest to build dir\n);\n```\n\nAn asset manifest, mapping the original paths to the revisioned paths, will be written to `build/assets/rev-manifest.json`:\n\n```json\n{\n\t\"css/unicorn.css\": \"css/unicorn-d41d8cd98f.css\",\n\t\"js/unicorn.js\": \"js/unicorn-273c2c123f.js\"\n}\n```\n\nBy default, `rev-manifest.json` will be replaced as a whole. To merge with an existing manifest, pass `merge: true` and the output destination (as `base`) to `rev.manifest()`:\n\n```js\nimport gulp from 'gulp';\nimport rev from 'gulp-rev';\n\nexport default () =\u003e (\n\t// By default, Gulp would pick `assets/css` as the base,\n\t// so we need to set it explicitly:\n\tgulp.src(['assets/css/*.css', 'assets/js/*.js'], {base: 'assets'})\n\t\t.pipe(gulp.dest('build/assets'))\n\t\t.pipe(rev())\n\t\t.pipe(gulp.dest('build/assets'))\n\t\t.pipe(rev.manifest({\n\t\t\tbase: 'build/assets',\n\t\t\tmerge: true // Merge with the existing manifest if one exists\n\t\t}))\n\t\t.pipe(gulp.dest('build/assets'))\n);\n```\n\nYou can optionally call `rev.manifest('manifest.json')` to give it a different path or filename.\n\n## Sourcemaps and `gulp-concat`\n\nBecause of the way `gulp-concat` handles file paths, you may need to set `cwd` and `path` manually on your `gulp-concat` instance to get everything to work correctly:\n\n```js\nimport gulp from 'gulp';\nimport rev from 'gulp-rev';\nimport sourcemaps from 'gulp-sourcemaps';\nimport concat from 'gulp-concat';\n\nexport default () =\u003e (\n\tgulp.src('src/*.js')\n\t\t.pipe(sourcemaps.init())\n\t\t.pipe(concat({path: 'bundle.js', cwd: ''}))\n\t\t.pipe(rev())\n\t\t.pipe(sourcemaps.write('.'))\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n## Different hash for unchanged files\n\nSince the order of streams are not guaranteed, some plugins such as `gulp-concat` can cause the final file's content and hash to change. To avoid generating a new hash for unchanged source files, you can:\n\n- Sort the streams with [gulp-sort](https://github.com/pgilad/gulp-sort)\n- Filter unchanged files with [gulp-unchanged](https://github.com/sindresorhus/gulp-changed)\n- Read more about [incremental builds](https://github.com/gulpjs/gulp#incremental-builds)\n\n## Streaming\n\nThis plugin does not support streaming. If you have files from a streaming source, such as Browserify, you should use [`gulp-buffer`](https://github.com/jeromew/gulp-buffer) before `gulp-rev` in your pipeline:\n\n```js\nimport gulp from 'gulp';\nimport browserify from 'browserify';\nimport source from 'vinyl-source-stream';\nimport buffer from 'gulp-buffer';\nimport rev from 'gulp-rev';\n\nexport default () =\u003e (\n\tbrowserify('src/index.js')\n\t\t.bundle({debug: true})\n\t\t.pipe(source('index.min.js'))\n\t\t.pipe(buffer())\n\t\t.pipe(rev())\n\t\t.pipe(gulp.dest('dist'))\n);\n```\n\n## Integration\n\nFor more info on how to integrate `gulp-rev` into your app, have a look at the [integration guide](integration.md).\n\n## Use gulp-rev in combination with one or more of\n\nIt may be useful - and necessary - to use `gulp-rev` with other packages to complete the task.\n\n- [gulp-rev-rewrite](https://github.com/TheDancingCode/gulp-rev-rewrite) - Rewrite occurrences of filenames which have been renamed\n- [gulp-rev-css-url](https://github.com/galkinrost/gulp-rev-css-url) - Override URLs in CSS files with the revved ones\n- [gulp-rev-outdated](https://github.com/shonny-ua/gulp-rev-outdated) - Old static asset revision files filter\n- [gulp-rev-collector](https://github.com/shonny-ua/gulp-rev-collector) - Static asset revision data collector\n- [rev-del](https://github.com/callumacrae/rev-del) - Delete old unused assets\n- [gulp-rev-delete-original](https://github.com/nib-health-funds/gulp-rev-delete-original) - Delete original files after rev\n- [gulp-rev-dist-clean](https://github.com/alexandre-abrioux/gulp-rev-dist-clean) - Clean up temporary and legacy files created by gulp-rev \n- [gulp-rev-loader](https://github.com/adjavaherian/gulp-rev-loader) - Use rev-manifest with webpack\n- [gulp-rev-format](https://github.com/atamas101/gulp-rev-format) - Provide hash formatting options for static assets (prefix, suffix, last-extension)\n- [gulp-rev-sri](https://github.com/shaunwarman/gulp-rev-sri) - Add subresource integrity field to rev-manifest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-rev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fgulp-rev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fgulp-rev/lists"}