Package Exports
- jsdoc-extractor
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-extractor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
jsdoc-extractor
Fast JSDoc extractor with no dependencies (parse the Buffer).
Requirements
- Node.js v10 or higher
Getting Started
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
$ npm i jsdoc-extractor
# or
$ yarn add jsdoc-extractorUsage example
const jsdocExtractor = require("jsdoc-extractor");
const { readFileSync } = require("fs");
const buf = readFileSync("./sourceCode.js");
for (const [doc, start, end] of jsdocExtractor(buf)) {
console.log(`Found a new JSDoc block between ${start} and ${end}`);
console.log(doc.toString());
console.log("-------------");
}API
jsdocExtractor(buf: Buffer): IterableIterator< [Buffer, number, number] >
Take a buffer as Argument and return a Synchronous Iterator. The value returned by the iterator is the following:
[buffer, start, end]Where start and end are the offset to retrieve (slice) the original Buffer.
Related projects
| name | description |
|---|---|
| jsdoc-tokenizer | Tokenizer for JSDoc blocks |
License
MIT