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.
clean-npm-installer
Advanced tools
Easily transform and pre-process npm modules for deployment scenarios
cni.conf.js
filenpm install
all your required packagesclean-npm-installer
module.exports = {
directory: 'javascript',
modules: {
'underscore': {
'<main>': 'underscore-<version>.js'
},
'backbone': {
'<main>': 'backbone-<version>.js'
}
}
};
output:
js/underscore-1.8.3.js
js/backbone-1.3.3.js
Use a gulp transform, such as uglify.
module.exports = {
directory: 'javascript',
modules: {
'underscore': {
'<main>': 'underscore-<version>.min.js!min'
}
},
transforms: {
min: {
module: 'gulp-uglify'
}
}
}
output:
js/underscore-1.3.3.min.js
Process with browserify using cni-transform-browserify.
If you specify a transform that isn't defined in your configuration, clean-npm-installer will auto-require a
module named cni-transform-<name>
.
module.exports = {
directory: 'javascript',
modules: {
'casual-browserify': {
'<main>': 'casual-<version>.min.js!browserify!min'
}
},
transforms: {
min: {
module: 'gulp-uglify'
}
}
}
output: a single casual-1.5.2.min.js
which has been bundled using browserify and
then minified with gulp-uglify.
This example demonstrates bundling jquery-ui, jquery and related css files. Start by installing
jquery
, jquery-ui
, gulp-uglify
and gulp-clean-css
.
module.exports = {
directory: 'assets',
modules: {
'jquery-ui': {
'<main>': 'js/jquery-and-jquery-ui-<version>.js!browserify!minjs',
'themes/le-frog/*.css': 'css/*-le-frog.css!mincss'
}
},
transforms: {
minjs: {
module: 'gulp-uglify'
},
mincss: {
module: 'gulp-clean-css'
}
}
};
output:
assets/css/jquery-ui-le-frog.css
assets/css/jquery-ui.min-le-frog.css
assets/css/jquery.ui.theme-le-frog.css
assets/js/jquery-ui-1.10.5.js
assets/js/jquery-and-jquery-ui-1.10.5.js
FAQs
Easily copy and transform npm modules for deployment
The npm package clean-npm-installer receives a total of 0 weekly downloads. As such, clean-npm-installer popularity was classified as not popular.
We found that clean-npm-installer 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.