
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
gulp-revise
Advanced tools
Opinionated, straight to the point assets revisioning.
Mostly inspired by gulp-rev.
dist/
app.js.rev
app_273c2cin3f.js
app_273c2cin3f.js.map
vendors.js.rev
vendors_d41d8cd98f.js
vendors_d41d8cd98f.js.map
src/
app.js
vendors.js
gulpfile.js
gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var uglify = require('gulp-uglify');
var revise = require('gulp-revise');
gulp.task('default', function () {
return gulp
.src('src/*.js')
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(revise())
.pipe(sourcemaps.write('.'))
.pipe(revise.write())
.pipe(gulp.dest('dist'))
;
});
app.js.rev
app_273c2cin3f.js
vendors.js.rev
vendors_d41d8cd98f.js
Adds the _hash
suffix to the files in the stream (hash
being the md5 of the file's content).
For each files that have been revised, creates a .rev
file that contains the file's name.
e.g app.js
is renamed to app_273c2cin3f.js
so the app.js.rev
contains app_273c2cin3f.js
.
The path to look for existing .rev
file so it can delete old revisions.
Should be the same as the one passed to gulp.dest()
.
Note: also delete the corresponding .map
files.
Merge the .rev
files in the stream to create a rev-manifest.json
file, e.g:
var gulp = require('gulp');
var revise = require('gulp-revise');
gulp.task('merge', function () {
return gulp
.src('dist/*.rev')
.pipe(revise.merge())
.pipe(gulp.dest(''));
});
rev-manifest.json
looks like this:
{
"dist/app.js": "dist/app_273c2cin3f.js",
"dist/vendors.js": "dist/vendors_d41d8cd98f"
}
By default, basePath is set to process.cwd()
which assumes the current working directory to be the root.
However, you can pass a custom base path, e.g:
var gulp = require('gulp');
var revise = require('gulp-revise');
gulp.task('merge', function () {
return gulp
.src('dist/*.rev')
.pipe(revise.merge('dist'))
.pipe(gulp.dest(''));
});
Will result in:
{
"app.js": "app_273c2cin3f.js",
"vendors.js": "vendors_d41d8cd98f"
}
noop utility that just adds the required props to the files for .write()
to work as usual.
That way the .rev
files are properly updated with the file's name, no hash added.
Example:
// var revise = require('gulp-revise');
if (isWatching) {
stream = stream.pipe(revise.noop());
} else {
stream = stream.pipe(revise());
}
.merge()
.merge()
.write()
to work with sub directories #3write()
no more requires the dest path (also fixes #3)Sadly, this version actually introduced a regression.
restore()
noop()
as a replacement for restore()
restore()
to rename files after their .revFirst release.
FAQs
Opinionated, straight to the point assets revisioning.
The npm package gulp-revise receives a total of 8 weekly downloads. As such, gulp-revise popularity was classified as not popular.
We found that gulp-revise 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.