Module Nodes

Provides classes representing particular kinds of data flow nodes, such as nodes corresponding to function definitions or nodes corresponding to parameters.

Import path

import semmle.javascript.dataflow.Nodes

Predicates

dependencyModuleImport

Gets a (default) import of the given dependency dep, such as require("lodash") in a context where a package.json file includes "lodash" as a dependency.

globalObjectRef

Gets a data flow node corresponding to an access to the global object, including this expressions outside functions, references to global variables window and global, and uses of the global npm package.

globalVarRef

Gets a data flow node corresponding to an access to global variable name, either directly, through window or global, or through the global npm package.

moduleImport

Gets a (default) import of the module with the given path, such as require("fs") or import * as fs from "fs".

moduleMember

Gets a data flow node that either imports m from the module with the given path, or accesses m as a member on a default or namespace import from path.

Classes

ArrayConstructorInvokeNode

A data flow node corresponding to a new Array() or Array() invocation.

ArrayCreationNode

A data flow node corresponding to the creation or a new array, either through an array literal, an invocation of the Array constructor, or the Array.from method.

ArrayLiteralNode

A data flow node corresponding to an array literal expression.

CallNode

A data flow node corresponding to a function call without new.

ClassNode

A data flow node corresponding to a class definition or a function definition acting as a class.

ExprNode

A data flow node corresponding to an expression.

FunctionNode

A data flow node corresponding to a function definition.

GlobalVarRefNode

A data flow node corresponding to a global variable access through a simple identifier.

InvokeNode

A data flow node corresponding to a function invocation (with or without new).

MemberKind

The string method, getter, or setter, representing the kind of a function member in a class.

MethodCallNode

A data flow node corresponding to a method call, that is, a call of form x.m(...).

ModuleImportNode

A data flow node representing an import of a module, either through an import declaration, a call to require, or an AMD dependency parameter.

NewNode

A data flow node corresponding to a new expression.

ObjectLiteralNode

A data flow node corresponding to an object literal expression.

ParameterNode

A data flow node corresponding to a parameter.

PartialInvokeNode

A data flow node that performs a partial function application.

RegExpConstructorInvokeNode

An invocation of the RegExp constructor.

RegExpCreationNode

A data flow node corresponding to a regular expression literal or an invocation of the RegExp constructor.

RegExpLiteralNode

A data-flow node corresponding to a regular-expression literal.

ThisNode

A data flow node corresponding to the this parameter in a function or this at the top-level.

Modules

Aliases

AdditionalPartialInvokeNode

DEPRECATED. Subclasses should extend PartialInvokeNode::Range instead, and predicates should use PartialInvokeNode instead.