CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.9.0 (changelog, source)
Search

Module NodeModuleResolutionImpl

INTERNAL: Do not use directly.

Provides predicates for modeling Node.js module resolution.

Import path

import semmle.javascript.NodeModuleResolutionImpl

Imports

javascript

Provides classes for working with JavaScript programs, as well as JSON, YAML and HTML.

Predicates

getFileExtensionPriority

Gets the priority with which a given file extension should be found by module resolution. Extensions with a lower numeric priority value are preferred.

loadAsDirectory

Gets the default main module of the folder that is the resolution target with the given priority of req when resolved from the root with priority rootPriority.

loadAsFile

Gets the resolution target with the given priority of req when resolved from the root with priority rootPriority.

numberOfExtensions
prioritiesPerCandidate
resolveMainModule

Gets the main module described by pkg with the given priority.

tryExtensions

Gets a file in folder dir whose name is of the form basename.extension, where extension has the given priority.

Classes

MainModulePath

A JSON string in a package.json file specifying the path of one of the exported modules of the package.

TypingsModulePathString

A JSON string in a package.json file specifying the path of the TypeScript typings entry point.

Modules

MainModulePath
TypingsModulePathString

Companion module to the TypingsModulePathString class.