Skip to content

Latest commit

 

History

History
65 lines (40 loc) · 1.17 KB

env.md

File metadata and controls

65 lines (40 loc) · 1.17 KB

WORK IN PROGRESS, NOT YET COMPLETE

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(napi_env env);
  • [in] env: The napi_env environment from which to construct the Env object.

napi_env

operator napi_env() const;

Returns the napi_env opaque data structure representing the environment.

Global

Object Global() const;

Returns the Object representing the environment's JavaScript Global Object.

Undefined

Value Undefined() const;

Returns the Value representing the environment's JavaScript Undefined Object.

Null

Value Null() const;

Returns the Value representing the environment's JavaScript Null Object.

IsExceptionPending

bool IsExceptionPending() const;

Returns a bool indicating if an exception is pending in the environment.

GetAndClearPendingException

Error GetAndClearPendingException();

Returns an Error object representing the environment's pending exception, if any.