Created
December 14, 2016 11:51
-
-
Save weepy/8fcd37a4303fb843fe31fa3ceb35537f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var glob = require("glob") | |
var fs = require("fs") | |
const all = [] | |
glob.sync(__dirname + "../bundles/**/*.preset").forEach( (path) => { | |
const str = fs.readFileSync(path) | |
try { | |
const json = JSON.parse(str) | |
all.push(json) | |
} | |
catch(e) { | |
throw("failed parsing json for", path) | |
} | |
}) | |
console.log(JSON.stringify(all, null, 2)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment