JSDoc annotations extractor
npm install jsdoc-extractor
Fast JSDoc extractor with no dependencies (parsing directly from Buffer input).
This package is available in the Node Package Repository and can be easily installed with npm or yarn.
``bash`
$ npm i jsdoc-extractoror
$ yarn add jsdoc-extractor
js
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
$3
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.
| name | description |
| --- | --- |
| jsdoc-tokenizer | Tokenizer for JSDoc blocks |

Thanks goes to these wonderful people (emoji key):
Gentilhomme 💻 📖 🐛 🛡️ |