Comparing version 2.0.2 to 2.0.3
'use strict' | ||
/** | ||
* A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features: | ||
* | ||
* - 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 | ||
* | ||
* @module jsdoc-api | ||
* @typicalname jsdoc | ||
* @example | ||
* > const jsdoc = require('jsdoc-api') | ||
* | ||
* > jsdoc.explainSync({ source: '/** example doclet *∕ \n var example = true' }) | ||
* | ||
* [ { comment: '/** example doclet *∕', | ||
* meta: | ||
* { range: [ 28, 42 ], | ||
* filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js', | ||
* lineno: 2, | ||
* path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T', | ||
* code: | ||
* { id: 'astnode100000002', | ||
* name: 'example', | ||
* type: 'Literal', | ||
* value: true } }, | ||
* description: 'example doclet', | ||
* name: 'example', | ||
* longname: 'example', | ||
* kind: 'member', | ||
* scope: 'global' }, | ||
* { kind: 'package', | ||
* longname: 'package:undefined', | ||
* files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ] | ||
*/ | ||
@@ -45,3 +14,3 @@ exports.explainSync = explainSync | ||
/** | ||
* The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()`, `.explainSync()` or `.createExplainStream()`. | ||
* The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()` or `.explainSync()`. | ||
* @type {external:cache-point} | ||
@@ -48,0 +17,0 @@ */ |
{ | ||
"name": "jsdoc-api", | ||
"author": "Lloyd Brookes <75pound@gmail.com>", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "A programmatic interface for jsdoc", | ||
@@ -33,3 +33,3 @@ "repository": "https://github.com/jsdoc2md/jsdoc-api.git", | ||
"rimraf": "^2.5.4", | ||
"test-runner": "~0.2.3" | ||
"test-runner": "~0.2.4" | ||
}, | ||
@@ -45,3 +45,3 @@ "dependencies": { | ||
"object-to-spawn-args": "^1.1.0", | ||
"promise.prototype.finally": "^2.0.0", | ||
"promise.prototype.finally": "^2.0.1", | ||
"temp-path": "^1.0.0", | ||
@@ -48,0 +48,0 @@ "then-fs": "^2.0.0", |
@@ -11,5 +11,4 @@ [![view on npm](http://img.shields.io/npm/v/jsdoc-api.svg)](https://www.npmjs.org/package/jsdoc-api) | ||
<a name="module_jsdoc-api"></a> | ||
# jsdoc-api | ||
## jsdoc-api | ||
A programmatic interface for [jsdoc3](https://github.com/jsdoc3/jsdoc) with a few features: | ||
@@ -22,29 +21,32 @@ | ||
**Example** | ||
## Synopsis | ||
```js | ||
> const jsdoc = require('jsdoc-api') | ||
> jsdoc.explainSync({ source: '/** example doclet *∕ \n var example = true' }) | ||
> jsdoc.explainSync({ source: '/** example doclet */ \n var example = true' }) | ||
[ { comment: '/** example doclet *∕', | ||
meta: | ||
{ range: [ 28, 42 ], | ||
filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js', | ||
lineno: 2, | ||
path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T', | ||
code: | ||
{ id: 'astnode100000002', | ||
name: 'example', | ||
type: 'Literal', | ||
value: true } }, | ||
description: 'example doclet', | ||
name: 'example', | ||
longname: 'example', | ||
kind: 'member', | ||
scope: 'global' }, | ||
{ kind: 'package', | ||
longname: 'package:undefined', | ||
files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ] | ||
meta: | ||
{ range: [ 28, 42 ], | ||
filename: 'nkrf18zlymohia4i29a0zkyt84obt9.js', | ||
lineno: 2, | ||
path: '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T', | ||
code: | ||
{ id: 'astnode100000002', | ||
name: 'example', | ||
type: 'Literal', | ||
value: true } }, | ||
description: 'example doclet', | ||
name: 'example', | ||
longname: 'example', | ||
kind: 'member', | ||
scope: 'global' }, | ||
{ kind: 'package', | ||
longname: 'package:undefined', | ||
files: [ '/var/folders/74/tqh7thm11tq72d7sjty9qvdh0000gn/T/nkrf18zlymohia4i29a0zkyt84obt9.js' ] } ] | ||
``` | ||
# API Reference | ||
* [jsdoc-api](#module_jsdoc-api) | ||
@@ -78,3 +80,3 @@ * _static_ | ||
### jsdoc.cache : <code>[cache-point](https://github.com/75lb/cache-point)</code> | ||
The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()`, `.explainSync()` or `.createExplainStream()`. | ||
The [cache-point](https://github.com/75lb/cache-point) instance used when `cache: true` is specified on `.explain()` or `.explainSync()`. | ||
@@ -244,5 +246,4 @@ **Kind**: static property of <code>[jsdoc-api](#module_jsdoc-api)</code> | ||
* * * | ||
© 2015-16 Lloyd Brookes \<75pound@gmail.com\>. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown). |
@@ -30,2 +30,7 @@ 'use strict' | ||
runner.test('.explainSync({ source }), defaults', function () { | ||
var output = jsdoc.explainSync({ source: '/** example doclet */ \n var example = true' }) | ||
a.strictEqual(output[0].description, 'example doclet') | ||
}) | ||
runner.test('.explainSync: no valid files', function () { | ||
@@ -32,0 +37,0 @@ a.throws( |
Sorry, the diff of this file is not supported yet
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
246
1106579
64
2373