1const fs = require('fs') 2const plock = require('../package-lock.json') 3fs.writeFileSync(`${__dirname}/../node_modules/.gitignore`, 4 '## Automatically generated dev dependency ignores\n' + 5 'CODE_OF_CONDUCT.md\n' + 6 'CONTRIBUTING.md\n' + 7 Object.keys(plock.dependencies).filter(_ => plock.dependencies[_].dev).map(_ => `/${_}`).join('\n') + '\n') 8