@babel/parser

  • Version 7.26.10
  • Published
  • 1.92 MB
  • 1 dependency
  • MIT license

Install

npm i @babel/parser
yarn add @babel/parser
pnpm add @babel/parser

Overview

A JavaScript parser

Index

Variables

variable tokTypes

const tokTypes: { [name: string]: any };

    Functions

    function parse

    parse: (input: string, options?: ParserOptions) => ParseResult<File>;
    • Parse the provided code as an entire ECMAScript program.

    function parseExpression

    parseExpression: (
    input: string,
    options?: ParserOptions
    ) => ParseResult<Expression>;

      Interfaces

      interface DecoratorsPluginOptions

      interface DecoratorsPluginOptions {}

        property allowCallParenthesized

        allowCallParenthesized?: boolean;

          property decoratorsBeforeExport

          decoratorsBeforeExport?: boolean;

            interface ParseError

            interface ParseError {}

              property code

              code: string;

                property reasonCode

                reasonCode: string;

                  interface PipelineOperatorPluginOptions

                  interface PipelineOperatorPluginOptions {}

                    property proposal

                    proposal: BABEL_8_BREAKING extends false
                    ? 'minimal' | 'fsharp' | 'hack' | 'smart'
                    : 'fsharp' | 'hack';

                      property topicToken

                      topicToken?: '%' | '#' | '@@' | '^^' | '^';

                        interface RecordAndTuplePluginOptions

                        interface RecordAndTuplePluginOptions {}

                          property syntaxType

                          syntaxType: 'bar' | 'hash';

                            interface TypeScriptPluginOptions

                            interface TypeScriptPluginOptions {}

                              property disallowAmbiguousJSXLike

                              disallowAmbiguousJSXLike?: boolean;

                                property dts

                                dts?: boolean;

                                  Type Aliases

                                  type FlowPluginOptions

                                  type FlowPluginOptions = BABEL_8_BREAKING extends true
                                  ? {
                                  all?: boolean;
                                  enums?: boolean;
                                  }
                                  : {
                                  all?: boolean;
                                  };

                                    type ParseResult

                                    type ParseResult<Result extends File | Expression = File> = Result & {
                                    errors: null | ParseError[];
                                    };

                                      type ParserOptions

                                      type ParserOptions = Partial<Options>;

                                        type ParserPlugin

                                        type PluginConfig = Plugin$1 | ParserPluginWithOptions;

                                          type ParserPluginWithOptions

                                          type ParserPluginWithOptions =
                                          | ['decorators', DecoratorsPluginOptions]
                                          | ['estree', { classFeatures?: boolean }]
                                          | IF_BABEL_7<['importAttributes', { deprecatedAssertSyntax: boolean }]>
                                          | IF_BABEL_7<['moduleAttributes', { version: 'may-2020' }]>
                                          | ['optionalChainingAssign', { version: '2023-07' }]
                                          | ['pipelineOperator', PipelineOperatorPluginOptions]
                                          | ['recordAndTuple', RecordAndTuplePluginOptions]
                                          | ['flow', FlowPluginOptions]
                                          | ['typescript', TypeScriptPluginOptions];

                                            Package Files (1)

                                            Dependencies (1)

                                            Dev Dependencies (6)

                                            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/@babel/parser.

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