Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Automatically install deps for any serverless project found
const path = require('path')
const globby = require('globby')
const execSync = require('child_process').execSync
globby(['*/serverless.yml']).then(paths => {
// Now run npm install
const command = `npm install`
paths.forEach((p) => {
var t = path.join(__dirname, p)
execSync(command, {
cwd: path.dirname(t),
stdio: [0, 1, 2]
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment