Comparing version 1.2.4 to 2.0.0
@@ -7,3 +7,2 @@ 'use strict'; | ||
exports.explain = explain; | ||
exports.createExplainStream = createExplainStream; | ||
exports.renderSync = renderSync; | ||
@@ -30,8 +29,2 @@ | ||
function createExplainStream(options) { | ||
options = new JsdocOptions(options); | ||
var ExplainStream = require('./explain-stream'); | ||
return new ExplainStream(explain, options); | ||
} | ||
function renderSync(options) { | ||
@@ -38,0 +31,0 @@ options = new JsdocOptions(options); |
@@ -6,4 +6,4 @@ 'use strict' | ||
* | ||
* - Sync, async (Promise) and streaming interfaces on the two main jsdoc operations ('explain' and 'render documentation'). | ||
* - Input (source code) can supplied as a string, set of file names/globs or a stream. | ||
* - Sync and async (Promise) interfaces on the two main jsdoc operations ('explain' and 'render documentation'). | ||
* - Input (source code) can supplied as a string or set of file names/globs. | ||
* - Optional caching, dramatically speeding up future invocations with the same input. | ||
@@ -41,3 +41,2 @@ * - Supports html input | ||
exports.explain = explain | ||
exports.createExplainStream = createExplainStream | ||
exports.renderSync = renderSync | ||
@@ -84,19 +83,2 @@ | ||
/** | ||
* Returns a duplex stream, into which you can pipe source code and receive explain output at the other end. | ||
* | ||
* @param [options] {module:jsdoc-api~JsdocOptions} | ||
* @returns {Duplex} | ||
* @static | ||
* @example | ||
* fs.createReadStream('source-code.js') | ||
* .pipe(jsdoc.createExplainStream()) | ||
* .pipe(process.stdout) | ||
*/ | ||
function createExplainStream (options) { | ||
options = new JsdocOptions(options) | ||
const ExplainStream = require('./explain-stream') | ||
return new ExplainStream(explain, options) | ||
} | ||
/** | ||
* Render jsdoc documentation. | ||
@@ -103,0 +85,0 @@ * |
{ | ||
"name": "jsdoc-api", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "1.2.4", | ||
"version": "2.0.0", | ||
"description": "A programmatic interface for jsdoc", | ||
@@ -31,3 +31,3 @@ "repository": "https://github.com/jsdoc2md/jsdoc-api.git", | ||
"coveralls": "^2.11.12", | ||
"jsdoc-to-markdown": "^1.3.7", | ||
"jsdoc-to-markdown": "^2.0.0-alpha.8", | ||
"rimraf": "^2.5.4", | ||
@@ -34,0 +34,0 @@ "test-runner": "~0.1.11" |
@@ -16,4 +16,4 @@ [![view on npm](http://img.shields.io/npm/v/jsdoc-api.svg)](https://www.npmjs.org/package/jsdoc-api) | ||
- Sync, async (Promise) and streaming interfaces on the two main jsdoc operations ('explain' and 'render documentation'). | ||
- Input (source code) can supplied as a string, set of file names/globs or a stream. | ||
- Sync and async (Promise) interfaces on the two main jsdoc operations ('explain' and 'render documentation'). | ||
- Input (source code) can supplied as a string or set of file names/globs. | ||
- Optional caching, dramatically speeding up future invocations with the same input. | ||
@@ -54,3 +54,2 @@ - Supports html input | ||
* [.explain([options])](#module_jsdoc-api.explain) ⇒ <code>Promise</code> | ||
* [.createExplainStream([options])](#module_jsdoc-api.createExplainStream) ⇒ <code>Duplex</code> | ||
* [.renderSync([options])](#module_jsdoc-api.renderSync) | ||
@@ -106,19 +105,2 @@ * _inner_ | ||
<a name="module_jsdoc-api.createExplainStream"></a> | ||
### jsdoc.createExplainStream([options]) ⇒ <code>Duplex</code> | ||
Returns a duplex stream, into which you can pipe source code and receive explain output at the other end. | ||
**Kind**: static method of <code>[jsdoc-api](#module_jsdoc-api)</code> | ||
| Param | Type | | ||
| --- | --- | | ||
| [options] | <code>[JsdocOptions](#module_jsdoc-api..JsdocOptions)</code> | | ||
**Example** | ||
```js | ||
fs.createReadStream('source-code.js') | ||
.pipe(jsdoc.createExplainStream()) | ||
.pipe(process.stdout) | ||
``` | ||
<a name="module_jsdoc-api.renderSync"></a> | ||
@@ -125,0 +107,0 @@ |
@@ -44,1 +44,5 @@ 'use strict' | ||
}) | ||
test('.explain({ files }): generate a warning', function () { | ||
return jsdoc.explain({ files: 'test/fixture/buggy/ignore-with-value.js' }) | ||
}) |
@@ -15,18 +15,1 @@ 'use strict' | ||
}) | ||
test('.createExplainStream({ files, html: true })', function () { | ||
var f = new Fixture('html', '0-src.html') | ||
return new Promise(function (resolve, reject) { | ||
jsdoc.createExplainStream({ files: f.sourcePath, html: true }) | ||
.pipe(collectJson(function (output) { | ||
var expectedOutput = f.getExpectedOutput(output) | ||
try { | ||
a.deepEqual(output, expectedOutput) | ||
resolve() | ||
} catch (err) { | ||
reject(err) | ||
} | ||
})) | ||
.on('error', reject) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1109374
65
2378
245