Skip to content

Commit

Permalink
removed .createExplainStream()
Browse files Browse the repository at this point in the history
  • Loading branch information
75lb committed Aug 19, 2016
1 parent ae3f5b3 commit 993491d
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 263 deletions.
22 changes: 2 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
## jsdoc-api
A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features:

- 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.
- Supports html input

Expand Down Expand Up @@ -50,7 +50,6 @@ A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a fe
* [.cache](#module_jsdoc-api.cache) : <code>[cache-point](https://github.com/75lb/cache-point)</code>
* [.explainSync([options])](#module_jsdoc-api.explainSync) ⇒ <code>Array.&lt;object&gt;</code>
* [.explain([options])](#module_jsdoc-api.explain) ⇒ <code>Promise</code>
* [.createExplainStream([options])](#module_jsdoc-api.createExplainStream) ⇒ <code>Duplex</code>
* [.renderSync([options])](#module_jsdoc-api.renderSync)
* _inner_
* [~JsdocOptions](#module_jsdoc-api..JsdocOptions)
Expand Down Expand Up @@ -101,23 +100,6 @@ Returns a promise for the jsdoc explain output.
| --- | --- |
| [options] | <code>[JsdocOptions](#module_jsdoc-api..JsdocOptions)</code> |

<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>

### jsdoc.renderSync([options])
Expand Down
7 changes: 0 additions & 7 deletions es5/jsdoc-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons

exports.explainSync = explainSync;
exports.explain = explain;
exports.createExplainStream = createExplainStream;
exports.renderSync = renderSync;

var path = require('path');
Expand All @@ -26,12 +25,6 @@ function explain(options) {
return command.execute();
}

function createExplainStream(options) {
options = new JsdocOptions(options);
var ExplainStream = require('./explain-stream');
return new ExplainStream(explain, options);
}

function renderSync(options) {
options = new JsdocOptions(options);
var RenderSync = require('./render-sync');
Expand Down
54 changes: 0 additions & 54 deletions lib/explain-stream.js

This file was deleted.

22 changes: 2 additions & 20 deletions lib/jsdoc-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/**
* A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features:
*
* - 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.
* - Supports html input
*
Expand Down Expand Up @@ -37,7 +37,6 @@
*/
exports.explainSync = explainSync
exports.explain = explain
exports.createExplainStream = createExplainStream
exports.renderSync = renderSync

const path = require('path')
Expand Down Expand Up @@ -78,23 +77,6 @@ function explain (options) {
return command.execute()
}

/**
* 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.
*
Expand Down
145 changes: 0 additions & 145 deletions test/createExplainStream.js

This file was deleted.

17 changes: 0 additions & 17 deletions test/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,3 @@ test('.explain({ files, html: true })', function () {
a.deepEqual(output, f.getExpectedOutput(output))
})
})

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)
})
})

0 comments on commit 993491d

Please sign in to comment.