Skip to content

Instantly share code, notes, and snippets.

@kenpusney
Created December 1, 2020 08:50
Show Gist options
  • Save kenpusney/08c26cc356f1cae594b970a82a0e1e56 to your computer and use it in GitHub Desktop.
Save kenpusney/08c26cc356f1cae594b970a82a0e1e56 to your computer and use it in GitHub Desktop.
Pack up all your code into single file
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