Skip to content

Instantly share code, notes, and snippets.

@callumlocke
Created February 19, 2014 09:51
Show Gist options
  • Save callumlocke/9089019 to your computer and use it in GitHub Desktop.
Save callumlocke/9089019 to your computer and use it in GitHub Desktop.
cd into a Node.js project, run node (CLI) and paste this in to time require calls
var modules = require('fs').readdirSync('node_modules').filter(function (name) {return name !== '.bin'});
modules.forEach(function (m) {
console.time(m);
require(m);
console.timeEnd(m);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment