{"id":13418922,"url":"https://github.com/outluch/gulp-rev-hash","last_synced_at":"2025-03-15T04:31:09.548Z","repository":{"id":15108206,"uuid":"17835054","full_name":"outluch/gulp-rev-hash","owner":"outluch","description":"Keeps a file's hash in file's links to your assets. For automatic cache updating purpose.","archived":false,"fork":true,"pushed_at":"2014-09-16T01:14:51.000Z","size":206,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-26T03:30:25.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"thomastuts/gulp-rev-mtime","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/outluch.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-03-17T16:32:11.000Z","updated_at":"2022-07-19T07:43:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/outluch/gulp-rev-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outluch%2Fgulp-rev-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outluch%2Fgulp-rev-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outluch%2Fgulp-rev-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/outluch%2Fgulp-rev-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/outluch","download_url":"https://codeload.github.com/outluch/gulp-rev-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685506,"owners_count":20330980,"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-07-30T22:01:08.905Z","updated_at":"2025-03-15T04:31:09.290Z","avatar_url":"https://github.com/outluch.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"gulp-rev-hash\n=============\n\n\u003e Keeps a file's hash in file's links to your assets. For automatic cache updating purpose.\n\n## Install\n\n```\nnpm install --save-dev gulp-rev-hash\n```\n\n\n## Examples\n\n### Default\n\nThis example will keep links to assets in `layouts/_base.ect` ECT template always updated on assets change. If your assets are not in root of your project, add assetsDir option, like this: `.pipe(revHash({assetsDir: 'public'}))`\n\n```js\nvar gulp = require('gulp');\nvar revHash = require('gulp-rev-hash');\n\ngulp.task('rev-hash', function () {\n\tgulp.src('layouts/_base.ect')\n\t\t.pipe(revHash())\n\t\t.pipe(gulp.dest('layouts'));\n});\n```\n\n#### Input:\n\n```html\n\u003c!-- rev-hash --\u003e\n\u003clink rel=\"stylesheet\" href=\"main.min.css\"\u003e\n\u003c!-- end --\u003e\n\n\u003c!-- rev-hash --\u003e\n\u003cscript src=\"abc.js?v=0401f2bda539bac50b0378d799c2b64e\"\u003e\u003c/script\u003e\n\u003cscript src=\"def.js?v=e478ca95198c5a901c52f7a0f91a5d00\"\u003e\u003c/script\u003e\n\u003c!-- end --\u003e\n```\n\n#### Output:\n\n```html\n\u003c!-- rev-hash --\u003e\n\u003clink rel=\"stylesheet\" href=\"main.min.css?v=9d58b7441d92130f545778e418d1317d\"\u003e\n\u003c!-- end --\u003e\n\n\u003c!-- rev-hash --\u003e\n\u003cscript src=\"abc.js?v=0401f2bda539bac50b0378d799c2b64e\"\u003e\u003c/script\u003e\n\u003cscript src=\"def.js?v=e478ca95198c5a901c52f7a0f91a5d00\"\u003e\u003c/script\u003e\n\u003c!-- end --\u003e\n```\n\nMain idea is that your template always contains a link with hash. So, if you use preprocessing for your assets (compass, less, stylus, coffeescript, dart), if you accidentally added empty line or empty item to your source, preprocessor will generate the same file and your cached resource will have the same hash. And your clients will not redownload file.\n\n### Custom options\n\n```\nassetsDir: 'public'\n```\n\nPath to assets in your project\n\n### Known issues\n\n* Assets links in template should be on new line each.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutluch%2Fgulp-rev-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foutluch%2Fgulp-rev-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foutluch%2Fgulp-rev-hash/lists"}