Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Gulp module for managing asset revisions and using multiple domains to server assets.
Gulp module for managing asset revisions and paths.
Creates revision using md5 hash of file contents and replaces all occurances of path in referencing files. Also allows you to prefix asset urls for balancing across cdn domains. It will also ensure that a single file only ever comes from the one prefix so assets aren't double downloaded.
Install with npm
npm install --save-dev gulp-asset
var gulp = require('gulp');
var asset = require('gulp-asset');
asset.config({
prefix: ['http://cdn1.google.com', 'http://cdn2.google.com']
});
gulp.task('js', function () {
gulp.src('src/assets/js/**/*.js')
.pipe(asset.rev())
.pipe(asset.replace())
.pipe(gulp.dest('dist/assets/js'));
});
Example JavaScript file
// You can explicitly use an asset:// string
var image = 'asset://img/image.png';
var font = 'asset://fonts/test.eot';
// Or construct a path and use the window.__assets variable
var key = 'asset://' + 'fonts/' + 'test' + '.eot';
var font = window.__assets[key];
Example HTML file
<img src="asset://img/image.png">
Example CSS file
body {
background: blue url('asset://img/image.png');
}
FAQs
Gulp module for managing asset revisions and using multiple domains to server assets.
We found that gulp-asset 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.