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'); // require is a special function provided by node | |
var path = require('path'); //require path function provided by node | |
var pathName = process.argv[2]; //full path name passed in as array | |
var ext = process.argv[3]; //extenstion we need to filter array by passed in as string | |
var filteredList = undefined; //Global variable. We do not know the file type, so I set to undefined. | |
function filteredLS(callback) { | |
fs.readdir(pathName, function doneReading(err, files) { //Async node call. Pass in pathname and async function |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder