Skip to content

Instantly share code, notes, and snippets.

View JoeKarlsson's full-sized avatar
🏠
Working from home

Joe Karlsson JoeKarlsson

🏠
Working from home
View GitHub Profile
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
@JoeKarlsson
JoeKarlsson / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console