1.3 KiB
1.3 KiB
Env
The opaque data structure containing the environment in which the request is being run.
The Env object is usually created and passed by the Node.js runtime or node-addon-api infrastructure.
Methods
Constructor
::Env::Env(napi_env env); Napi
[in] env
: Thenapi_env
environment from which to construct theNapi::Env
object.
napi_env
operator napi_env() const;
Returns the napi_env
opaque data structure representing
the environment.
Global
::Object Napi::Env::Global() const; Napi
Returns the Napi::Object
representing the environment’s
JavaScript Global Object.
Undefined
::Value Napi::Env::Undefined() const; Napi
Returns the Napi::Value
representing the environment’s
JavaScript Undefined Object.
Null
::Value Napi::Env::Null() const; Napi
Returns the Napi::Value
representing the environment’s
JavaScript Null Object.
IsExceptionPending
bool Napi::Env::IsExceptionPending() const;
Returns a bool
indicating if an exception is pending in
the environment.
GetAndClearPendingException
::Error Napi::Env::GetAndClearPendingException(); Napi
Returns an Napi::Error
object representing the
environment’s pending exception, if any.