Created
December 1, 2020 08:50
-
-
Save kenpusney/08c26cc356f1cae594b970a82a0e1e56 to your computer and use it in GitHub Desktop.
Pack up all your code into single file
This file contains 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
const glob = require('glob'); | |
const fs = require("fs"); | |
const EXCLUSION_PATTERNS = /min/; | |
glob("**/*.*", function(err, files) { | |
files.forEach(f => { | |
if (fs.statSync(f).isDirectory() || EXCLUSION_PATTERNS.test(f)) { | |
return | |
} | |
let s = fs.readFileSync(f, "utf-8"); | |
console.log("/// filename: " + f) | |
console.log(s) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment