We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.
The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.
When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.
To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!
Node-API Exports
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url]
C utilities for registering Node-API modules.
bash
npm install @stdlib/napi-export
javascript
var headerDir = require( '@stdlib/napi-export' );
#### headerDir
Absolute file path for the directory containing header files for C APIs.
javascript
var dir = headerDir;
// returns <string>
javascript
var headerDir = require( '@stdlib/napi-export' );
console.log( headerDir );
// => <string>
c
#include "stdlib/napi/export.h"
#### STDLIB_NAPI_MODULE_EXPORT_FCN( name )
Macro for registering a Node-API module which exports a function.
c
#include <node_api.h>
// ...
static napi_value addon( napi_env env, napi_callback_info info ) {
// ...
}
// ...
// Register a Node-API module:
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )
The macro expects the following arguments:
- name: name of the C function to export.
When used, this macro should be used instead of NAPI_MODULE
. The macro includes NAPI_MODULE
, thus ensuring Node-API module registration.