Skip to main content
Module

x/ts_morph/ts_morph.js>Node

TypeScript Compiler API wrapper for static analysis and programmatic code changes.
Very Popular
Go to Latest
class Node
import { Node } from "https://deno.land/x/ts_morph@20.0.0/ts_morph.js";

Constructors

new
Node(
context,
node,
sourceFile,
)

Properties

readonly
_sourceFile
readonly
compilerNode

Methods

_getAncestorsIterator(includeSyntaxLists)
_getCommentsAtPos(pos, getComments)
appendWhitespace(textOrWriterFunction)
asKind(kind)
asKindOrThrow(kind, message)
containsRange(pos, end)
forEachChild(cbNode, cbNodeArray)
forEachDescendant(cbNode, cbNodeArray)
formatText(settings?)
getAncestors(includeSyntaxLists?)
getChildAtIndexIfKindOrThrow(
index,
kind,
message,
)
getFirstAncestor(condition)
getFirstAncestorOrThrow(condition, message)
getFirstChild(condition)
getFirstChildOrThrow(condition, message)
getFirstDescendantOrThrow(condition, message)
getLastChild(condition)
getLastChildOrThrow(condition, message)
getLocal(name)
getLocalOrThrow(name, message)
getNextSibling(condition)
getNextSiblingOrThrow(condition, message)
getNodeProperty(propertyName)
getParentIf(condition)
getParentIfKindOrThrow(kind, message)
getParentIfOrThrow(condition, message)
getParentWhile(condition)
getParentWhileOrThrow(condition, message)
getPreviousSiblingOrThrow(condition, message)
getStart(includeJsDocComments)
getStartLineNumber(includeJsDocComments)
getStartLinePos(includeJsDocComments)
getText(includeJsDocCommentOrOptions)
getWidth(includeJsDocComments)
isKind(kind)
prependWhitespace(textOrWriterFunction)
print(options?)
replaceWithText(textOrWriterFunction, writer)
transform(visitNode)

Static Methods

hasBody(node)
hasName(node)
is(kind)
isBodied(node)
isModuled(node)
isNamed(node)
isNode(value)
isScoped(node)
isTyped(node)