Skip to content

Class jac::NodeModuleLoaderFeature

template <class Next>

ClassList > jac > NodeModuleLoaderFeature

Inherits the following classes: Next

Public Static Attributes

Type Name
const std::set< std::string_view > defaultConditions = { "jaculus", "node", "import" }

Public Functions

Type Name
Value evalFile (std::string path_)
Evaluate a file.
void evalFileWithEventLoop (std::string path_)
Evaluate a file and run the event loop until the program exits or throws an exception.
void initialize ()

Public Static Functions

Type Name
std::string ESM_RESOLVE (const std::string & specifier, NodeModuleLoaderFeature< Next > & self)
std::string PACKAGE_EXPORTS_RESOLVE (const std::string & packageURL, const std::string & subpath, jac::Value exports, NodeModuleLoaderFeature< Next > & self)
std::optional< std::string > PACKAGE_IMPORTS_EXPORTS_RESOLVE (const std::string & matchKey, jac::Object matchObj, const std::string & packageURL, NodeModuleLoaderFeature< Next > & self)
std::string PACKAGE_RESOLVE (const std::string & packageSpecifier, NodeModuleLoaderFeature< Next > & self)
std::optional< std::string > PACKAGE_SELF_RESOLVE (const std::string & packageName, const std::string & packageSubpath, NodeModuleLoaderFeature< Next > & self)
std::optional< std::string > PACKAGE_TARGET_RESOLVE (const std::string & packageURL, jac::Value target, std::optional< std::string > patternMatch, NodeModuleLoaderFeature< Next > & self)
jac::Object READ_PACKAGE_JSON (const std::string & packageURL, NodeModuleLoaderFeature< Next > & self)

Public Static Attributes Documentation

variable defaultConditions

const std::set<std::string_view> jac::NodeModuleLoaderFeature< Next >::defaultConditions;

Public Functions Documentation

function evalFile

Evaluate a file.

inline Value jac::NodeModuleLoaderFeature::evalFile (
    std::string path_
) 

Parameters:

  • path_ Path to the file

Returns:

A promise that will be resolved when the module ends, and rejected if the module throws an exception.


function evalFileWithEventLoop

Evaluate a file and run the event loop until the program exits or throws an exception.

inline void jac::NodeModuleLoaderFeature::evalFileWithEventLoop (
    std::string path_
) 

Parameters:

  • path_ Path to the file

function initialize

inline void jac::NodeModuleLoaderFeature::initialize () 

Public Static Functions Documentation

function ESM_RESOLVE

static inline std::string jac::NodeModuleLoaderFeature::ESM_RESOLVE (
    const std::string & specifier,
    NodeModuleLoaderFeature < Next > & self
) 

function PACKAGE_EXPORTS_RESOLVE

static inline std::string jac::NodeModuleLoaderFeature::PACKAGE_EXPORTS_RESOLVE (
    const std::string & packageURL,
    const std::string & subpath,
    jac::Value exports,
    NodeModuleLoaderFeature < Next > & self
) 

function PACKAGE_IMPORTS_EXPORTS_RESOLVE

static inline std::optional< std::string > jac::NodeModuleLoaderFeature::PACKAGE_IMPORTS_EXPORTS_RESOLVE (
    const std::string & matchKey,
    jac::Object matchObj,
    const std::string & packageURL,
    NodeModuleLoaderFeature < Next > & self
) 

function PACKAGE_RESOLVE

static inline std::string jac::NodeModuleLoaderFeature::PACKAGE_RESOLVE (
    const std::string & packageSpecifier,
    NodeModuleLoaderFeature < Next > & self
) 

function PACKAGE_SELF_RESOLVE

static inline std::optional< std::string > jac::NodeModuleLoaderFeature::PACKAGE_SELF_RESOLVE (
    const std::string & packageName,
    const std::string & packageSubpath,
    NodeModuleLoaderFeature < Next > & self
) 

function PACKAGE_TARGET_RESOLVE

static inline std::optional< std::string > jac::NodeModuleLoaderFeature::PACKAGE_TARGET_RESOLVE (
    const std::string & packageURL,
    jac::Value target,
    std::optional< std::string > patternMatch,
    NodeModuleLoaderFeature < Next > & self
) 

function READ_PACKAGE_JSON

static inline jac::Object jac::NodeModuleLoaderFeature::READ_PACKAGE_JSON (
    const std::string & packageURL,
    NodeModuleLoaderFeature < Next > & self
) 


The documentation for this class was generated from the following file src/jac/features/nodeModuleLoaderFeature.h