Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsdoc-parse

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdoc-parse

Transforms jsdoc data into something more suitable for use as template input

  • 6.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is jsdoc-parse?

The jsdoc-parse npm package is a tool for parsing JSDoc comments in JavaScript files and generating JSON output. It is useful for extracting documentation information from code comments and can be integrated into documentation generation workflows.

What are jsdoc-parse's main functionalities?

Parsing JSDoc comments

This feature allows you to parse JSDoc comments from JavaScript code and generate a JSON representation of the documentation. The code sample demonstrates how to parse a simple JSDoc comment and output the parsed JSON.

const jsdocParse = require('jsdoc-parse');
const fs = require('fs');

const jsdocComments = `
/**
 * Adds two numbers together.
 * @param {number} a - The first number.
 * @param {number} b - The second number.
 * @returns {number} The sum of the two numbers.
 */
function add(a, b) {
  return a + b;
}
`;

jsdocParse({ src: jsdocComments }).then(output => {
  console.log(JSON.stringify(output, null, 2));
});

Generating JSON output

This feature allows you to generate JSON output from JSDoc comments and save it to a file. The code sample demonstrates how to parse JSDoc comments and write the resulting JSON to a file named 'output.json'.

const jsdocParse = require('jsdoc-parse');
const fs = require('fs');

const jsdocComments = `
/**
 * Multiplies two numbers together.
 * @param {number} a - The first number.
 * @param {number} b - The second number.
 * @returns {number} The product of the two numbers.
 */
function multiply(a, b) {
  return a * b;
}
`;

jsdocParse({ src: jsdocComments }).then(output => {
  fs.writeFileSync('output.json', JSON.stringify(output, null, 2));
});

Other packages similar to jsdoc-parse

Keywords

FAQs

Package last updated on 01 Sep 2024

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc