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.
Browserify plugin that bans certain packages from being imported.
Normally you should do this at the package manager level (e.g. using dependency-ban). However, this plugin is useful in scenarios when you want to use a dependency but want to ensure that only parts of it are ever included in the browserify build.
This plugin is inspired by Apache Maven Enforcer Plugin.
Let's say you are using lodash and only cherry-picking certain functions to keep the resulting bundle small.
var find = require('lodash/collection/find');
You want to enforce that no one accidentally requires all of lodash (e.g. by require('lodash')
) because that would invalidate the effort. You can use banify to do that:
var banify = require('banify');
var BLACKLIST = [
'lodash',
];
gulp.src(['./index.js'])
.pipe(bro({
plugin: [banify(BLACKLIST)]
}))
The plugin fails the build if require('lodash')
or is found anywhere in the codebase. Other imports (e.g. require('lodash/collection/find')
) will succeed.
Besides exact matches a blacklist can also contain regular expressions:
var BLACKLIST = [
/lodash\/fp\/.*/,
];
FAQs
Browserify plugin that enforces that certain packages are not imported
The npm package banify receives a total of 0 weekly downloads. As such, banify popularity was classified as not popular.
We found that banify 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.