Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
parsec-gulp-rev-collector
Advanced tools
Static asset revision data collector from manifests, generated from different streams, and replace their links in html template.
Static asset revision data collector from manifests, generated from different streams, and replace their links in html template.
$ npm install --save-dev parsec-gulp-rev-collector
We can use parsec-gulp-rev to cache-bust several assets and generate manifest files for them. Then using parsec-gulp-rev-collector we can collect data from several manifest files and replace links to assets in html templates.
var gulp = require('gulp');
var rev = require('parsec-gulp-rev');
gulp.task('css', function () {
return gulp.src('src/css/*.css')
.pipe(rev())
.pipe(gulp.dest('dist/css'))
.pipe( rev.manifest() )
.pipe( gulp.dest( 'rev/css' ) );
});
gulp.task('scripts', function () {
return gulp.src('src/js/*.js')
.pipe(rev())
.pipe(gulp.dest('dist/js'))
.pipe( rev.manifest() )
.pipe( gulp.dest( 'rev/js' ) );
});
...
var revCollector = require('parsec-gulp-rev-collector');
var minifyHTML = require('gulp-minify-html');
gulp.task('rev', function () {
return gulp.src(['rev/**/*.json', 'templates/**/*.html'])
.pipe( revCollector({
replaceReved: true,
dirReplacements: {
'css': '/dist/css',
'/js/': '/dist/js/',
'cdn/': function(manifest_value) {
return '//cdn' + (Math.floor(Math.random() * 9) + 1) + '.' + 'exsample.dot' + '/img/' + manifest_value;
}
}
}) )
.pipe( minifyHTML({
empty:true,
spare:true
}) )
.pipe( gulp.dest('dist') );
});
Type : Boolean
You set a flag, replaceReved, which will replace alredy replaced links in template's files. Default value is false
.
Specifies a directories replacement set. parsec-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.css?v=1d87bebe"
"/js/script1.js" => "/dist/script1.js?v=61e0be79"
"cdn/image.gif" => "//cdn8.example.dot/img/image.gif?v=35c3af8134"
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.
FAQs
Static asset revision data collector from manifests, generated from different streams, and replace their links in html template.
The npm package parsec-gulp-rev-collector receives a total of 3 weekly downloads. As such, parsec-gulp-rev-collector popularity was classified as not popular.
We found that parsec-gulp-rev-collector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.