# jsdoc-extractor

> JSDoc annotations extractor

Latest version **3.2.0** (published 2022-09-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install jsdoc-extractor
pnpm add jsdoc-extractor
yarn add jsdoc-extractor
bun add jsdoc-extractor
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2022-09-05 |
| First published | 2017-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | GENTILHOMME.Thomas |
| Maintainers | fraxken |
| Keywords | jsdoc, extractor, buffer, fast, extract, parse, parser |

## Links

- npm: https://www.npmjs.com/package/jsdoc-extractor
- Repository: https://github.com/fraxken/jsdoc-extractor
- Homepage: https://github.com/fraxken/jsdoc-extractor#readme
- Issues: https://github.com/fraxken/jsdoc-extractor/issues
- npm.io page: https://npm.io/package/jsdoc-extractor

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2022-09-05
- 3.1.1 — 2019-09-13
- 3.1.0 — 2019-06-17
- 3.0.0 — 2019-05-14
- 2.1.0 — 2019-04-11
- 2.0.0 — 2019-03-26
- 1.0.0 — 2017-12-02

## README

<p align="center"><h1 align="center">
  jsdoc-extractor
</h1>

<p align="center">
  Fast JSDoc extractor with no dependencies (parsing directly from Buffer input).
</p>

<p align="center">
<img src="https://img.shields.io/badge/dynamic/json.svg?url=https://raw.githubusercontent.com/fraxken/jsdoc-extractor/master/package.json&amp;query=$.version&amp;label=Version" alt="version">
<a href="https://github.com/fraxken/jsdoc-extractor/commit-activity">
  <img src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" alt="Maintenance">
</a>
<img src="https://img.shields.io/github/license/mashape/apistatus.svg" alt="MIT">
<img src="https://img.shields.io/bundlephobia/min/jsdoc-extractor.svg" alt="size">
<a href="https://snyk.io/test/github/fraxken/jsdoc-extractor?targetFile=package.json">
  <img src="https://snyk.io/test/github/fraxken/jsdoc-extractor/badge.svg?targetFile=package.json" alt="Known Vulnerabilities">
</a>
<a href="https://github.com/fraxken/jsdoc-extractor">
  <img src="https://img.shields.io/github/workflow/status/fraxken/jsdoc-extractor/Node.js%20CI" alt="githubaction">
</a>
</p>


## Requirements
- Node.js v14 or higher

## Getting Started

This package is available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).

```bash
$ npm i jsdoc-extractor
# or
$ yarn add jsdoc-extractor
```

## Usage example
```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

### 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](https://github.com/fraxken/jsdoc-tokenizer) | Tokenizer for JSDoc blocks |

## Contributors ✨

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
  <tr>
    <td align="center"><a href="https://www.linkedin.com/in/thomas-gentilhomme/"><img src="https://avatars.githubusercontent.com/u/4438263?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Gentilhomme</b></sub></a><br /><a href="https://github.com/fraxken/jsdoc-extractor/commits?author=fraxken" title="Code">💻</a> <a href="https://github.com/fraxken/jsdoc-extractor/commits?author=fraxken" title="Documentation">📖</a> <a href="https://github.com/fraxken/jsdoc-extractor/issues?q=author%3Afraxken" title="Bug reports">🐛</a> <a href="#security-fraxken" title="Security">🛡️</a></td>
  </tr>
</table>

<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

## License
MIT

---
_Source: https://npm.io/package/jsdoc-extractor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
