JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3778
  • Score
    100M100P100Q115850F
  • License MIT

Parser to output a customized Javascript object via JSDoc's explain (-X) command.

Package Exports

  • jsdoc-x

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jsdoc-x) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jsdoc-x

npm release license

Parser to output a customized Javascript object via JSDoc's explain (-X) command.

Under development...

Author: Onur Yıldırım (@onury)
© 2016 — Licensed under the MIT License.

Install via NPM:

npm install jsdoc-x

Usage:

var jsdocx = require('jsdoc-x');

jsdocx.parse()

Executes the jsdoc -X command and parses the output into a Javascript object/array; with the specified options.

with Promise...

jsdocx.parse(options)
    .then(function (docs) {
        console.log(docs);
    })
    .catch(function (err) {
        console.log(err.stack);
    });

Or callback...

jsdocx.parse(options, function (err, docs) {
    if (err) {
        console.log(err.stack);
        return;
    }
    console.log(docs);
});

Options:

Option Type Default Description
files String|Array undefined Required (if source is not set). One or more file/directory paths to be processed.
source String undefined (NOT IMPLEMENTED YET) Required (if files is not set). Documented source code to be processed.
encoding String "utf8" Encoding to be used when reading source files.
recurse Boolean false Specifies whether to recurse into subdirectories when scanning for source files.
pedantic Boolean false Specifies whether to treat errors as fatal errors, and treat warnings as errors.
access String|Array undefined Specifies which symbols to be processed with the given access property. Possible values: "private", "protected", "public" or "all" (for all access levels). By default, all except private symbols are processed. Note that, if access is not set for a documented symbol, it will still be included, regardless of this option.
private Boolean false
package String undefined The path to the package.json file that contains the project name, version, and other details. If set to true instead of a path string, the first package.json file found in the source paths.
module Boolean true Specifies whether to include module.exports symbols.
undocumented Boolean true Specifies whether to include undocumented symbols.
undescribed Boolean true Specifies whether to include symbols without a description.
relativePath String undefined When set, all symbol.meta.path values will be relative to this path.
filter Function undefined This is used to filter the parsed documentation output array. If a Function is passed; it's invoked for each included symbol. e.g. function (symbol) { return symbol; } Returning a falsy value will remove the symbol from the output. Returning true will keep the original symbol. To keep the symbol and alter its contents, simply return an altered symbol object.
output String|Object undefined Path for a JSON file to be created, containing the output documentation array. Or you can set this to an object for extra options.
        <table>
            <tr>
                <td>Option</td>
                <td>Type</td>
                <td>Default</td>
                <td>Description</td>
            </tr>
            <tr>
                <td><b><code>output.path</code></b></td>
                <td><code>String</code></td>
                <td><code>undefined</code></td>
                <td>Path for a JSON file to be created.</td>
            </tr>
            <tr>
                <td><b><code>output.indent</code></b></td>
                <td><code>Boolean|Number</code></td>
                <td><code>false</code></td>
                <td>Number of spaces for indentation. If set to <code>true</code>, 2 spaces will be used.</td>
            </tr>
            <tr>
                <td><b><code>output.force</code></b></td>
                <td><code>Boolean</code></td>
                <td><code>false</code></td>
                <td>Whether to create parent directories if they don't exist.</td>
            </tr>
        </table>
    </td>
</tr>