drop-modules
Version:
A quick and simple tool to find and remove node_modules folders from your machine. Frees up space and keeps your workspace tidy!
22 lines (17 loc) • 486 B
JavaScript
const { spawn } = require('child_process')
const path = require('path')
const binaryPath = path.join(__dirname, 'bin', 'drop-modules')
const currentDir = process.cwd()
const child = spawn(binaryPath, [currentDir], {
stdio: 'inherit',
cwd: currentDir,
})
child.on('error', (err) => {
console.error('Failed to start subprocess:', err)
process.exit(1)
})
child.on('close', (code) => {
console.log('Binary exited with code:', code)
process.exit(code)
})