Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/zeusdeux/c-node-native-addon-example

Simple Node.js native addon written in C
https://github.com/zeusdeux/c-node-native-addon-example

Last synced: 13 days ago
JSON representation

Simple Node.js native addon written in C

Awesome Lists containing this project

README

        

# C based Node.js native addon

Teaching myself how to write native addons for Node.js in C.

> je ne parle pas C++ ¯\\\_(ツ)\_/¯

To use the exported function, do &emdash;

```bash
pnpm build &>/dev/null && node -e 'console.log("Value returned from addon:", require("./addon").hello())'
```

## Learnings

- The `target_name` in `binding.gyp` is what is passed to `bindings(...)` in `/addon.js`