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

@ts-ast-parser/comment

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-ast-parser/comment

Parses documentation comments

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@ts-ast-parser/comment

General purpose parser for documentation comments that tries to follow as much as possible the JSDoc 3 spec and the TSDoc spec.

Install

npm i @ts-ast-parser/comment

Usage

import { parse } from '@ts-ast-parser/comment';

const comment = `/** This is a simple description */`;
const parserResult = parse(comment);

if (parserResult.error) {
    // Handle the errors accordingly
    process.exit(1);
}

// This is an array of `CommentPart`
const parts = parserResult.parts;

// This would log "This is a simple description"
console.log(parts.find(p => p.kind === 'description')?.text ?? '');

Keywords

FAQs

Package last updated on 01 Oct 2023

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