Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 385 Bytes
var fs = require('fs');
var path = require('path');
function getFilesFor(dir) {
return fs.readdirSync(path.join(__dirname, '/' + dir));
}
module.exports = function getChallenges() {
try {
return getFilesFor('challenges')
.map(function(file) {
return require('./challenges/' + file);
});
} catch (e) {
console.log('error', e);
return [];
}
};
Something went wrong with that request. Please try again.