Skip to content

Instantly share code, notes, and snippets.

@pmarques
Last active June 9, 2017 14:45
Show Gist options
  • Save pmarques/21636eb9eb2a357f604a8f9574cf7187 to your computer and use it in GitHub Desktop.
Save pmarques/21636eb9eb2a357f604a8f9574cf7187 to your computer and use it in GitHub Desktop.
Lambda function to print NodeJS installed packages
const fs = require('fs')
exports.handler = (event, context, callback) => {
module.paths.concat('/var/runtime/node_modules')
.forEach((path) => {
if (!fs.existsSync(path))
return;
const d = fs.readdirSync(path);
console.log(path, d);
})
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment