Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/deno2node/src/deps.deno.ts>BodyableNode

Compile your Deno project to run on Node.js.
Go to Latest
interface BodyableNode
import { type BodyableNode } from "https://deno.land/x/deno2node@v1.10.0/src/deps.deno.ts";

Methods

getBodyOrThrow(message?: string | (() => string)): Node

Gets the body or throws an error if it doesn't exist.

getBody(): Node | undefined

Gets the body if it exists.

getBodyText(): string | undefined

Gets the body text without leading whitespace, leading indentation, or trailing whitespace. Returns undefined if there is no body.

hasBody(): boolean

Gets if the node has a body.

setBodyText(textOrWriterFunction: string | WriterFunction): this

Sets the body text. A body is required to do this operation.

addBody(): this

Adds a body if it doesn't exists.

removeBody(): this

Removes the body if it exists.

function BodyableNode
import { BodyableNode } from "https://deno.land/x/deno2node@v1.10.0/src/deps.deno.ts";

Type Parameters

T extends Constructor<BodyableNodeExtensionType>