Add helper script for extracting list of options and languages

This commit is contained in:
Glavin Wiechert 2016-09-04 22:52:52 -03:00
parent 7dbfb7fe7c
commit ead89d2404
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
jsonStringify = require('json-stable-stringify')
Languages = require('../src/languages')
languages = new Languages().languages
# console.log(languages.length)
_ = require('lodash')
# options = _.chain(languages)
# .map((lang) -> return lang.options or [])
# .flatten()
# .reduce((result, value) ->
# _.merge(result, value)
# return result
# , {})
# .value()
# console.log(jsonStringify(options, {
# space: 2
# }))
langs = _.chain(languages)
.map((lang) ->
return {
name: lang.name,
namespace: lang.namespace,
extensions: lang.extensions or [],
atomGrammars: lang.grammars or [],
sublimeSyntaxes: []
}
)
.value()
console.log(jsonStringify(langs, {
space: 2
}))