Last active
November 19, 2018 09:27
-
-
Save delebash/df7a9249d034e2573057 to your computer and use it in GitHub Desktop.
outputs kss to json string
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
//install kss and fs-extra: npm install kss fs-extra | |
var kss = require('kss'), | |
options = { | |
markdown: false | |
}; | |
var fs = require('fs-extra'); | |
var file = './docs/kss.json'; | |
kss.traverse('.', options, function (err, styleguide) { | |
if (err) throw err; | |
var mySections = styleguide.section(); | |
var myJsonSections = [] | |
for (var i = 0, tot = mySections.length; i < tot; i++) { | |
myJsonSections.push(mySections[i].JSON()); | |
} | |
fs.outputJson(file, myJsonSections, function (err) { | |
console.log(err) // => null | |
}) | |
}); |
airtonix
commented
Mar 23, 2018
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment