Skip to content

Instantly share code, notes, and snippets.

View VinGarcia's full-sized avatar
💭
I may be slow to respond.

Vinícius Garcia VinGarcia

💭
I may be slow to respond.
  • Belo Horizonte - MG, Brazil
View GitHub Profile
@VinGarcia
VinGarcia / walksync.js
Last active September 9, 2020 11:18 — forked from kethinov/walksync.js
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
if( dir[dir.length-1] != '/') dir=dir.concat('/')
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {