jsdoc-to-markdown
Advanced tools
Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6
@@ -15,3 +15,8 @@ 'use strict'; | ||
var options = cli.options._all; | ||
options = loadStoredConfig(options); | ||
if (options['no-usage-stats']) usageStats.disable(); | ||
usageStats.start(); | ||
if (options.help) { | ||
@@ -22,3 +27,3 @@ tool.printOutput(cli.usage); | ||
} else if (options.clear) { | ||
usageStats.screenView('clear').send(); | ||
usageStats.screenView('clear').send().end(); | ||
var jsdoc2md = require('../../'); | ||
@@ -28,3 +33,2 @@ jsdoc2md.clear().catch(tool.halt); | ||
var _jsdoc2md = require('../../'); | ||
options = loadStoredConfig(options); | ||
@@ -37,3 +41,3 @@ Object.keys(options).forEach(function (option) { | ||
if (options.config) { | ||
usageStats.screenView('config').send(); | ||
usageStats.screenView('config').send().end(); | ||
var omit = require('lodash.omit'); | ||
@@ -53,3 +57,3 @@ tool.stop(JSON.stringify(omit(options, 'config'), null, ' ')); | ||
if (options.json) { | ||
usageStats.screenView('json').send(); | ||
usageStats.screenView('json').send().end(); | ||
_jsdoc2md.getTemplateData(options).then(function (json) { | ||
@@ -59,3 +63,3 @@ tool.printOutput(JSON.stringify(json, null, ' ')); | ||
} else if (options.jsdoc) { | ||
usageStats.screenView('jsdoc').send(); | ||
usageStats.screenView('jsdoc').send().end(); | ||
_jsdoc2md.getJsdocData(options).then(function (json) { | ||
@@ -65,3 +69,3 @@ tool.printOutput(JSON.stringify(json, null, ' ')); | ||
} else if (options.stats) { | ||
usageStats.screenView('stats').send(); | ||
usageStats.screenView('stats').send().end(); | ||
_jsdoc2md.getStats(options.files).then(function (json) { | ||
@@ -71,3 +75,3 @@ tool.printOutput(JSON.stringify(json, null, ' ')); | ||
} else { | ||
usageStats.screenView('gen').send(); | ||
usageStats.screenView('gen').send().end(); | ||
var fs = require('fs'); | ||
@@ -74,0 +78,0 @@ if (options.template) options.template = fs.readFileSync(options.template, 'utf8'); |
{ | ||
"name": "jsdoc-to-markdown", | ||
"author": "Lloyd Brookes", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "jsdoc-annotated source in, markdown API docs out.", | ||
@@ -36,3 +36,3 @@ "repository": "https://github.com/jsdoc2md/jsdoc-to-markdown", | ||
"jsdoc-parse": "^2.0.5-0", | ||
"usage-stats": "~0.1.0", | ||
"usage-stats": "~0.1.1", | ||
"walk-back": "^2.0.1" | ||
@@ -39,0 +39,0 @@ }, |
@@ -14,3 +14,9 @@ 'use strict' | ||
let options = cli.options._all | ||
options = loadStoredConfig(options) | ||
/* when disabled, all usageStats methods are no-ops */ | ||
if (options['no-usage-stats']) usageStats.disable() | ||
usageStats.start() | ||
/* jsdoc2md --help */ | ||
@@ -26,3 +32,3 @@ if (options.help) { | ||
} else if (options.clear) { | ||
usageStats.screenView('clear').send() | ||
usageStats.screenView('clear').send().end() | ||
const jsdoc2md = require('../../') | ||
@@ -33,3 +39,2 @@ jsdoc2md.clear().catch(tool.halt) | ||
const jsdoc2md = require('../../') | ||
options = loadStoredConfig(options) | ||
@@ -43,3 +48,3 @@ Object.keys(options).forEach(option => { | ||
if (options.config) { | ||
usageStats.screenView('config').send() | ||
usageStats.screenView('config').send().end() | ||
const omit = require('lodash.omit') | ||
@@ -62,3 +67,3 @@ tool.stop(JSON.stringify(omit(options, 'config'), null, ' ')) | ||
if (options.json) { | ||
usageStats.screenView('json').send() | ||
usageStats.screenView('json').send().end() | ||
jsdoc2md.getTemplateData(options) | ||
@@ -72,3 +77,3 @@ .then(function (json) { | ||
} else if (options.jsdoc) { | ||
usageStats.screenView('jsdoc').send() | ||
usageStats.screenView('jsdoc').send().end() | ||
jsdoc2md | ||
@@ -83,3 +88,3 @@ .getJsdocData(options) | ||
} else if (options.stats) { | ||
usageStats.screenView('stats').send() | ||
usageStats.screenView('stats').send().end() | ||
jsdoc2md | ||
@@ -94,3 +99,3 @@ .getStats(options.files) | ||
} else { | ||
usageStats.screenView('gen').send() | ||
usageStats.screenView('gen').send().end() | ||
const fs = require('fs') | ||
@@ -97,0 +102,0 @@ if (options.template) options.template = fs.readFileSync(options.template, 'utf8') |
56009
995
Updatedusage-stats@~0.1.1