
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
flatten-dev-deps
Advanced tools
Flatten npm devDependencies by pruning them and reinstalling.
npm i -g flatten-dev-deps
cd PROJECT_ROOT
flatten-dev-deps
This runs the following commands on your npm package:
rm -rf node_modules
npm install
rm package-lock.json // or npm-shrinkwrap.json, whichever exists
sed -i '' 's/devDependencies/xdevDependencies/' package.json
npm prune
sed -i '' 's/xdevDependencies/devDependencies/' package.json
{ forEach devDependencies do npm install --save-dev dependency }
npm shrinkwrap --dev
Create flatten-dev-deps.config.js in the root of your project:
module.exports = {
quiet: false, // default
modifyPackageJson: false, // default - whether to pass '--save-dev' to 'npm install <devDeps>'
preFlatten: ({depVersionMap, exec, fs}) => {
// Runs before re-installing each dev dependency, can modify which dependencies get installed at
// which version.
delete depVersionMap['npm-shrinkwrap'] // skip dep
Object.keys(depVersionMap, (depName) => {
let version = '' // use latest minor version
if (depName === 'eslint') version = '4.9.0'
if (depName === 'react') version = '~15.6.2'
depVersionMap[depName] = version
})
},
preShrinkwrap: ({depVersionMap, exec, fs}) => {
// Runs before 'npm shrinkwrap --dev'
exec('rm -rf node_modules/fsevents')
})
}
npm install
npm start
node dist/index.js
FAQs
Flatten dev dependencies
We found that flatten-dev-deps 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.