Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

napi-macros

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

napi-macros - npm Package Compare versions

Comparing version 1.4.1 to 1.5.0

2

package.json
{
"name": "napi-macros",
"version": "1.4.1",
"version": "1.5.0",
"description": "Set of utility macros to make writing N-API modules a little easier.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -206,2 +206,31 @@ # napi-macros

#### `NAPI_STATUS_THROWS(call)`
Checks the return status of any `napi_*` function returning a `napi_status` type. This simplifies using a `napi_status` variable and comparing the result with `napi_ok`. It's used internally but can be used stand alone as well.
```c
NAPI_STATUS_THROWS(
napi_create_threadsafe_function(
NULL,
callback,
0,
async_resource_name,
0,
3,
0,
my_finalize,
NULL,
my_callback,
&threadsafe_function
)
);
```
Above example will fail because the first `env` parameter is `NULL` and throw the following error:
```
Error: napi_create_threadsafe_function(NULL, callback, 0, async_resource_name, 0, 3, 0, my_finalize, \
NULL, my_callback, &threadsafe_function) failed!
```
#### `NAPI_UV_THROWS(err, fn)`

@@ -208,0 +237,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc