Last active
August 29, 2015 13:57
-
-
Save tarzak/9682304 to your computer and use it in GitHub Desktop.
Обидва файли
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myFirstModule = require("./myFirstModule"); | |
myFirstModule.start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
path = require('path'), | |
pathName = process.argv[2], | |
fileExt = "." + process.argv[3], i; | |
function start(){ | |
function callback(err, list){ | |
for (i in list) | |
if (path.extname(list[i]) === fileExt) | |
console.log(list[i]); | |
}; | |
fs.readdir(pathName, callback); | |
} | |
exports.start = start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
От тут обидва файли і я відразу писав exports.start = start; виявляється). Значить йому щось інше не подобається :(.