Skip to main content

@unplugin/ast@0.16.0
Built and signed on GitHub Actions

Works with
This package works with Node.js, BunIt is unknown whether this package works with Cloudflare Workers, Deno, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
It is unknown whether this package works with Deno
This package works with Bun
It is unknown whether this package works with Browsers
JSR Score88%
Published3 months ago (0.16.0)

Manipulate the AST to transform your code.

Functions

f
resolveOptions(options: Options): OptionsResolved
No documentation available
f
transform(
code: string,
id: string,
options: Pick<OptionsResolved, "parserOptions" | "transformer">
): Promise<CodeTransform | undefined>
No documentation available

Interfaces

I
No documentation available
  • set: (node: T) => void
    No documentation available
  • No documentation available
I
No documentation available
  • enforce: "post" | "pre" | undefined
    No documentation available
  • exclude: FilterPattern
    No documentation available
  • include: FilterPattern
    No documentation available
  • parserOptions: ParserOptions
    No documentation available
  • transformer: Arrayable<Transformer<any>>
    No documentation available
I
No documentation available
  • finalize: (s: MagicStringAST) => Awaitable<void>

    It will be called after all nodes are transformed

  • onNode:
    ((
    node: Node,
    parent: Node | null | undefined,
    index: number | null | undefined
    ) => Awaitable<boolean>)

    | ((
    node: Node,
    parent: Node | null | undefined,
    index: number | null | undefined
    ) => node is T)

    Filter nodes to transform

  • transform: (
    node: T,
    code: string,
    context: { id: string; }
    ) => Awaitable<string | Node | false | undefined | null>

    Transform the node to a new node or string

  • transformInclude: (id: string) => Awaitable<boolean>

    Filter files to transform

I
No documentation available
  • nodes: NodeRef<Node | undefined>[]
    No documentation available
  • transformer: Transformer
    No documentation available

Type Aliases

T
OptionsResolved = Overwrite<
Required<Options>,
{ exclude: Options["exclude"]; enforce: Options["enforce"]; transformer: Transformer<any>[]; }
>
No documentation available

Variables

v
AST: UnpluginInstance<Options, false>
No documentation available

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@unplugin/ast

Import symbol

import * as mod from "@unplugin/ast";
or

Import directly with a jsr specifier

import * as mod from "jsr:@unplugin/ast";