Skip to content

Instantly share code, notes, and snippets.

@weepy
Created December 14, 2016 11:51
Show Gist options
  • Save weepy/8fcd37a4303fb843fe31fa3ceb35537f to your computer and use it in GitHub Desktop.
Save weepy/8fcd37a4303fb843fe31fa3ceb35537f to your computer and use it in GitHub Desktop.
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