Module name, or path to a file in the package.
Loads a module or data file. The argument is resolved as follows:
./ or ../: a path relative to the current file;Loads .js (CommonJS), .ts (ES module syntax, transpiled) and .json
files. Results are cached, so requiring the same argument twice returns the
same instance. Returns undefined if nothing is found. Paths beginning with
/, or using .. to escape the package directory, are not valid.
TypeScript files may use import syntax instead; it is transpiled to
require() calls.
Module name, or path to a file in the package.
Loads a module or data file. The argument is resolved as follows:
./or../: a path relative to the current file;Loads
.js(CommonJS),.ts(ES module syntax, transpiled) and.jsonfiles. Results are cached, so requiring the same argument twice returns the same instance. Returnsundefinedif nothing is found. Paths beginning with/, or using..to escape the package directory, are not valid.TypeScript files may use
importsyntax instead; it is transpiled torequire()calls.