Skip to content

Instantly share code, notes, and snippets.

View tommedema's full-sized avatar
🎯
Focusing

Tom Medema tommedema

🎯
Focusing
View GitHub Profile
@tommedema
tommedema / fileIterator.js
Created May 13, 2012 10:27 — forked from Raynos/0usage.js
Iterate all the files
var fs = require("fs"),
path = require("path");
function iterateFiles(uri, callback, done, fileRegexp) {
var counter = 1
fs.readdir(uri, errorProxy(done, readFiles))
function readFiles(err, files) {
counter += files.length
files.forEach(isDirOrFile)