Socket
Socket
Sign inDemoInstall

jsdoc-extractor

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdoc-extractor

JSDoc annotations extractor


Version published
Maintainers
1
Created

Readme

Source

jsdoc-extractor

Fast JSDoc extractor with no dependencies (parsing directly from Buffer input).

version Maintenance MIT size Known Vulnerabilities githubaction

Requirements

  • Node.js v14 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-extractor

Usage 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.

namedescription
jsdoc-tokenizerTokenizer for JSDoc blocks

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):


Gentilhomme

💻 📖 🐛 🛡️

License

MIT

Keywords

FAQs

Last updated on 05 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc