{"id":16982046,"url":"https://github.com/tenphi/gulp-revplace","last_synced_at":"2026-05-08T19:31:31.829Z","repository":{"id":18723047,"uuid":"21934173","full_name":"tenphi/gulp-revplace","owner":"tenphi","description":"Simple helper for gulp-rev to fix all asset references","archived":false,"fork":false,"pushed_at":"2015-02-08T12:34:31.000Z","size":293,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-29T19:53:20.677Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tenphi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-17T08:22:00.000Z","updated_at":"2018-08-30T09:27:03.000Z","dependencies_parsed_at":"2022-09-26T21:51:26.791Z","dependency_job_id":null,"html_url":"https://github.com/tenphi/gulp-revplace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tenphi/gulp-revplace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fgulp-revplace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fgulp-revplace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fgulp-revplace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fgulp-revplace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tenphi","download_url":"https://codeload.github.com/tenphi/gulp-revplace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tenphi%2Fgulp-revplace/sbom","scorecard":{"id":873869,"data":{"date":"2025-08-11","repo":{"name":"github.com/tenphi/gulp-revplace","commit":"bf017f2c5b705b49eba9f4c0b7cf8e09d14031d4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"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":"Code-Review","score":1,"reason":"Found 3/24 approved changesets -- score normalized to 1","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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 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-24T05:12:33.077Z","repository_id":18723047,"created_at":"2025-08-24T05:12:33.077Z","updated_at":"2025-08-24T05:12:33.077Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2024-10-14T02:07:10.353Z","updated_at":"2026-05-08T19:31:31.802Z","avatar_url":"https://github.com/tenphi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [gulp](http://gulpjs.com)-revplace\n\nSimple helper for [gulp-rev](http://github.com/sindresorhus/gulp-rev) to fix all asset references. It works with relative urls too! By default it doesn't pass through assets that are not mentioned in source files. This plugin can be very useful in your build scenarios.\n\n## Install\n\n```bash\n$ npm install --save-dev gulp-revplace\n```\n\n## Usage\n\nStructure before rev:\n\n```bash\n.\n├── build\n└── static\n    ├── images\n    │   ├── cat.png\n    │   ├── ghost.png\n    │   ├── pumpkin.png\n    │   └── zombie.png\n    ├── index.html\n    ├── scripts\n    │   └── script.js\n    └── styles\n        └── style.css\n```\n\n`script.js` and `style.css` have references to all images. `index.html` have references to `script.js` and `style.css`.\n\n```css\n/* style.css */\n.first { background-image: url(/images/ghost.png); }\n.second { background-image: url(/images/pumpkin.png); }\n.third { background-image: url(../images/pumpkin.png); }\n```\n\n```javascript\n// script.js\n(function() {\n  var absoluteImageUrl = ASSET('/images/cat.png');\n  var relativeImageUrl = ASSET('../images/cat.png');\n  var absoluteImageUrl2 = ASSET('/images/zombie.png');\n})();\n```\n\n```html\n\u003c!-- index.html --\u003e\n\u003c!doctype html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003clink type=\"text/css\" rel=\"stylesheet\" href=\"styles/style.css\"/\u003e\n  \u003cscript src=\"scripts/script.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\nLet's make simple gulp task:\n\n```javascript\nvar gulp = require('gulp');\nvar rev = require('gulp-rev');\nvar revplace = require('gulp-revplace');\nvar es = require('event-stream');\nvar baseDir = 'static';\n\ngulp.task('default', function () {\n  return es.merge(\n    gulp\n      .src([baseDir + '/index.html'], { base: baseDir }),\n    gulp\n      .src([baseDir + '/*/**/*.*'], { base: baseDir })\n      .pipe(rev())\n  )\n    .pipe(revplace())\n    .pipe(gulp.dest('build'));\n});\n```\n\nAfter execution file names will be changed and all references will be replaced.\n\n```bash\n.\n├── build\n│   ├── images\n│   │   ├── cat-1ccfa741.png\n│   │   ├── ghost-aa908d61.png\n│   │   ├── pumpkin-5ca50d04.png\n│   │   └── zombie-68157885.png\n│   ├── index.html\n│   ├── scripts\n│   │   └── script-921c4eaf.js\n│   └── styles\n│       └── style-cc726e1b.css\n└── static\n    ├── images\n    │   ├── cat.png\n    │   ├── ghost.png\n    │   ├── pumpkin.png\n    │   └── zombie.png\n    ├── index.html\n    ├── scripts\n    │   └── script.js\n    └── styles\n        └── style.css\n```\n\n```css\n/* style.css */\n.first { background-image: url(/images/ghost-61865acd.png); }\n.second { background-image: url(/images/pumpkin-cb05ce1b.png); }\n.third { background-image: url(/images/pumpkin-cb05ce1b.png); }\n```\n\n```javascript\n// script.js\n(function() {\n  var absoluteImageUrl = ASSET('/images/cat-5d0e5c9b.png');\n  var relativeImageUrl = ASSET('/images/cat-5d0e5c9b.png');\n  var absoluteImageUrl2 = ASSET('/images/zombie-0dc22dba.png');\n})();\n```\n\n```html\n\u003c!-- index.html --\u003e\n\u003c!doctype html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003ctitle\u003eTest page\u003c/title\u003e\n  \u003clink type=\"text/css\" rel=\"stylesheet\" href=\"/styles/style-21373b83.css\"/\u003e\n  \u003cscript src=\"/scripts/script-6bc83506.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\nYou can even change `dirname`s of your files. It will also work like a charm.\n\n```javascript\ngulp.task('default', function () {\n  return es.merge(\n    gulp\n      .src([baseDir + '/index.html'], { base: baseDir }),\n    gulp\n      .src([baseDir + '/*/**/*.*'], { base: baseDir })\n      .pipe(rev())\n  )\n    .pipe(rename(function(path) {\n      path.dirname = '';\n    }))\n    .pipe(revplace())\n    .pipe(gulp.dest('build'));\n});\n```\n\nStructure will be changed...\n\n```\n.\n├── cat-5d0e5c9b.png\n├── ghost-61865acd.png\n├── index.html\n├── pumpkin-cb05ce1b.png\n├── script-6bc83506.js\n├── style-21373b83.css\n└── zombie-0dc22dba.png\n```\n\n...as well as file references.\n\n```css\n/* style.css */\n.first { background-image: url(/ghost-61865acd.png); }\n.second { background-image: url(/pumpkin-cb05ce1b.png); }\n.third { background-image: url(/pumpkin-cb05ce1b.png); }\n```\n\n```javascript\n// script.js\n(function() {\n  var absoluteImageUrl = ASSET('/cat-5d0e5c9b.png');\n  var relativeImageUrl = ASSET('/cat-5d0e5c9b.png');\n  var absoluteImageUrl2 = ASSET('/zombie-0dc22dba.png');\n})();\n```\n\n```html\n\u003c!-- index.html --\u003e\n\u003c!doctype html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003ctitle\u003eTest page\u003c/title\u003e\n  \u003clink type=\"text/css\" rel=\"stylesheet\" href=\"/style-21373b83.css\"/\u003e\n  \u003cscript src=\"/script-6bc83506.js\"\u003e\u003c/script\u003e\n\u003c/head\u003e\n\u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\n## API\n\n### revplace(options)\n\n#### regex\n\n_Type_: [`RegExp`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp)\n\n_Usage_: Sets a custom regex to match on your files.\n\n_Default_: `/(?:url\\([\"']?(.*?)['\"]?\\)|src=[\"'](.*?)['\"]|src=([^\\s\\\u003e]+)(?:\\\u003e|\\s)|href=[\"'](.*?)['\"]|href=([^\\s\\\u003e]+)(?:\\\u003e|\\s)|ASSET\\(['\"](.+)['\"]\\))/g`\n\nYou can define and use simple ASSET() function that only returns what it was given. Use it to declare asset urls in scripts. It'll help plugin to find all assets.\n\n```javascript\nfunction ASSET(s) {return s;}\n```\n\n#### addPrefix\n_Type_: `String`\n\n_Usage_: Add prefix to replaced urls\n\n_Default_: `/`\n\n#### stripPrefix\n_Type_: `String`\n\n_Usage_: Strip prefix from initial urls\n\n#### skipUnmentioned\n_Type_: `Boolean`\n\n_Usage_: If TRUE only assets that are mentioned in source files will be passed through stream. Source files are always passed.\n\n_Default_: true\n\n#### verbose\n_Type_: `Boolean`\n\n_Usage_: Activate verbose mode\n\n## License\n\n[MIT](http://opensource.org/licenses/MIT) © [Andrey Yamanov](http://tenphi.me)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fgulp-revplace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftenphi%2Fgulp-revplace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftenphi%2Fgulp-revplace/lists"}