
const fs = require('fs');
const path = require('path');

function walk(dir) {
    let results = [];
    const list = fs.readdirSync(dir);
    list.forEach(file => {
        file = path.resolve(dir, file);
        const stat = fs.statSync(file);
        if (stat && stat.isDirectory()) {
            results = results.concat(walk(file));
        } else {
            if (file.match(/\.(woff2?|ttf|eot|svg)$/i)) {
                results.push(file);
            }
        }
    });
    return results;
}

const allFiles = walk('c:/xampp/htdocs/doormileweb');
allFiles.forEach(f => console.log(f));
