for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
'use strict'
const util = require('../util')
const Kits = {
cache: []
}
Kits.list = function (callback) {
if (Kits.cache.length) {
callback(Kits.cache)
return
var stopSpinner = util.output.wait('Loading available starter kits')
util.request('kits/short').end(function (response) {
if (response.error || !response.body) {
stopSpinner(response.error)
process.exit()
stopSpinner()
var list = response.body.data.sort(function (a, b) {
if (a === 'basic') {
return -1
if (b === 'basic') {
return 1
return a > b ? 1 : -1
})
Kits.cache = list
callback(list)
module.exports = Kits