comment-parser

  • Version 1.4.1
  • Published
  • 366 kB
  • No dependencies
  • MIT license

Install

npm i comment-parser
yarn add comment-parser
pnpm add comment-parser

Overview

Generic JSDoc-like comment parser

Index

Variables

variable stringify

const stringify: Stringifier;

    variable tokenizers

    const tokenizers: {
    tag: typeof tagTokenizer;
    type: typeof typeTokenizer;
    name: typeof nameTokenizer;
    description: typeof descriptionTokenizer;
    };

      variable transforms

      const transforms: {
      flow: typeof flowTransform;
      align: typeof alignTransform;
      indent: typeof indentTransform;
      crlf: typeof crlfTransform;
      };

        variable util

        const util: {
        rewireSpecs: typeof rewireSpecs;
        rewireSource: typeof rewireSource;
        seedBlock: typeof seedBlock;
        seedTokens: typeof seedTokens;
        };

          Functions

          function inspect

          inspect: ({ source }: Block) => string;

            function parse

            parse: (
            source: string,
            options?: Partial<ParserOptions>
            ) => import('./primitives.js').Block[];

              Interfaces

              interface Block

              interface Block {}

                property description

                description: string;

                  property problems

                  problems: Problem[];

                    property source

                    source: Line[];

                      property tags

                      tags: Spec[];

                        interface BlockMarkers

                        interface BlockMarkers {}

                          property delim

                          delim: string;

                            property end

                            end: string;

                              property nostart

                              nostart: string;

                                property start

                                start: string;

                                  interface Line

                                  interface Line {}

                                    property number

                                    number: number;

                                      property source

                                      source: string;

                                        property tokens

                                        tokens: Tokens;

                                          interface Problem

                                          interface Problem {}

                                            property code

                                            code:
                                            | 'unhandled'
                                            | 'custom'
                                            | 'source:startline'
                                            | 'spec:tag:prefix'
                                            | 'spec:type:unpaired-curlies'
                                            | 'spec:name:unpaired-brackets'
                                            | 'spec:name:empty-name'
                                            | 'spec:name:invalid-default'
                                            | 'spec:name:empty-default';

                                              property critical

                                              critical: boolean;

                                                property line

                                                line: number;

                                                  property message

                                                  message: string;

                                                    interface Spec

                                                    interface Spec {}

                                                      property default

                                                      default?: string;

                                                        property description

                                                        description: string;

                                                          property name

                                                          name: string;

                                                            property optional

                                                            optional: boolean;

                                                              property problems

                                                              problems: Problem[];

                                                                property source

                                                                source: Line[];

                                                                  property tag

                                                                  tag: string;

                                                                    property type

                                                                    type: string;

                                                                      interface Tokens

                                                                      interface Tokens {}

                                                                        property delimiter

                                                                        delimiter: string;

                                                                          property description

                                                                          description: string;

                                                                            property end

                                                                            end: string;

                                                                              property lineEnd

                                                                              lineEnd: string;

                                                                                property name

                                                                                name: string;

                                                                                  property postDelimiter

                                                                                  postDelimiter: string;

                                                                                    property postName

                                                                                    postName: string;

                                                                                      property postTag

                                                                                      postTag: string;

                                                                                        property postType

                                                                                        postType: string;

                                                                                          property start

                                                                                          start: string;

                                                                                            property tag

                                                                                            tag: string;

                                                                                              property type

                                                                                              type: string;

                                                                                                Enums

                                                                                                enum Markers

                                                                                                enum Markers {
                                                                                                start = '/**',
                                                                                                nostart = '/***',
                                                                                                delim = '*',
                                                                                                end = '*/',
                                                                                                }
                                                                                                • Deprecated

                                                                                                member delim

                                                                                                delim = '*'

                                                                                                  member end

                                                                                                  end = '*/'

                                                                                                    member nostart

                                                                                                    nostart = '/***'

                                                                                                      member start

                                                                                                      start = '/**'

                                                                                                        Package Files (3)

                                                                                                        Dependencies (0)

                                                                                                        No dependencies.

                                                                                                        Dev Dependencies (8)

                                                                                                        Peer Dependencies (0)

                                                                                                        No peer dependencies.

                                                                                                        Badge

                                                                                                        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/comment-parser.

                                                                                                        • Markdown
                                                                                                          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/comment-parser)
                                                                                                        • HTML
                                                                                                          <a href="https://www.jsdocs.io/package/comment-parser"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>