Installations
npm install juyuan-gulp-rev-collector
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
10.16.3
NPM Version
6.11.3
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
xhl-China
Download Statistics
Total Downloads
930
Last Day
1
Last Week
6
Last Month
19
Last Year
97
GitHub Statistics
1 Commits
2 Watching
1 Branches
1 Contributors
Bundle Size
2.62 kB
Minified
1.18 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.0.4
Package Id
juyuan-gulp-rev-collector@0.0.4
Unpacked Size
12.86 kB
Size
4.35 kB
File Count
4
NPM Version
6.11.3
Node Version
10.16.3
Total Downloads
Cumulative downloads
Total Downloads
930
Last day
0%
1
Compared to previous day
Last week
20%
6
Compared to previous week
Last month
216.7%
19
Compared to previous month
Last year
-13.4%
97
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
gulp-rev-collector
Static asset revision data collector from manifests, generated from different streams, and replace their links in html template.
Install
1$ npm install --save gulp-rev-collector
Usage
We can use gulp-rev to cache-bust several assets and generate manifest files for them. Then using gulp-rev-collector we can collect data from several manifest files and replace links to assets in html templates.
1var gulp = require('gulp'); 2var rev = require('gulp-rev'); 3 4gulp.task('css', function () { 5 return gulp.src('src/css/*.css') 6 .pipe(rev()) 7 .pipe(gulp.dest('dist/css')) 8 .pipe( rev.manifest() ) 9 .pipe( gulp.dest( 'rev/css' ) ); 10}); 11 12gulp.task('scripts', function () { 13 return gulp.src('src/js/*.js') 14 .pipe(rev()) 15 .pipe(gulp.dest('dist/js')) 16 .pipe( rev.manifest() ) 17 .pipe( gulp.dest( 'rev/js' ) ); 18}); 19 20... 21 22var revCollector = require('gulp-rev-collector'); 23var minifyHTML = require('gulp-minify-html'); 24 25gulp.task('rev', function () { 26 return gulp.src(['rev/**/*.json', 'templates/**/*.html']) 27 .pipe( revCollector({ 28 replaceReved: true, 29 dirReplacements: { 30 'css': '/dist/css', 31 '/js/': '/dist/js/', 32 'cdn/': function(manifest_value) { 33 return '//cdn' + (Math.floor(Math.random() * 9) + 1) + '.' + 'exsample.dot' + '/img/' + manifest_value; 34 } 35 } 36 }) ) 37 .pipe( minifyHTML({ 38 empty:true, 39 spare:true 40 }) ) 41 .pipe( gulp.dest('dist') ); 42});
Options
collectedManifest
Type : String
It is a filename for collecded and merged manifest data in json
format.
replaceReved
Type : Boolean
You set a flag, replaceReved, which will replace alredy replaced links in template's files. Default value is false
.
dirReplacements
Type : Object
Specifies a directories replacement set. gulp-rev creates manifest files without any info about directories. E.c. if you use dirReplacements param from Usage example, you get next replacement:
"/css/style.css" => "/dist/css/style-1d87bebe.css"
"/js/script1.js" => "/dist/script1-61e0be79.js"
"cdn/image.gif" => "//cdn8.example.dot/img/image-35c3af8134.gif"
revSuffix
Type : String
It is pattern for define reved files suffixes. Default value is '-[0-9a-f]{8,10}-?'. This is necessary in case of e.c. gulp-rename usage. If reved filenames had different from default mask.
extMap
Type : Object
If You use some methods to modify the rev_manifest.json after use gulp-rev and get a result like this:
{
"assets/less/common.less": "assets/css/common-2c0d21e40c.css"
}
It means that keys and values in the rev_manifest.json have different ext : less & css.
You can define extentions maping rules for correct manifest file processing.
Default value is:
{
'.scss': '.css',
'.less': '.css',
'.jsx': '.js'
}
Works with gulp-rev-collector
License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
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
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
3
/10
Last Scanned on 2025-01-20
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More