Skip to content

Instantly share code, notes, and snippets.

@hedgerh
Last active August 29, 2015 14:03
Show Gist options
  • Save hedgerh/8c1c460a13f76eaabe76 to your computer and use it in GitHub Desktop.
Save hedgerh/8c1c460a13f76eaabe76 to your computer and use it in GitHub Desktop.
c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:152
processors[i].call(self, mode, function (err, pass) {
^
TypeError: Cannot call method 'call' of undefined
at next (c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:152:19)
at c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\node_modules\workshopper-exercise\exercise.js:159:7
at callback (c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:25:15)
at modFileError (c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:30:5)
at c:\Users\Aweesome\AppData\Roaming\npm\node_modules\learnyounode\exercises\make_it_modular\verify.js:103:18
at g:\sites\hello\exercise6\mymodule.js:14:17
at Array.forEach (native)
at callback (g:\sites\hello\exercise6\mymodule.js:12:14)
at Object.oncomplete (fs.js:107:15)
var fs = require('fs');
var path = require('path');
module.exports = function(folder, ext, cb) {
var extension = '.' + ext;
fs.readdir(folder, function callback(err, list) {
if (err) {
console.log(err);
return cb(err);
}
list.forEach(function(file) {
if (path.extname(file) === extension) {
cb(file);
}
})
});
}
var mymodule = require('./mymodule.js');
mymodule(process.argv[2], process.argv[3], function(file) {
console.log(file);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment