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

https://github.com/datkt/napi

N-API C Interop for Kotlin/Native
https://github.com/datkt/napi

binding c cinterop interop kotlin kotlin-native n-api napi native node

Last synced: about 1 month ago
JSON representation

N-API C Interop for Kotlin/Native

Awesome Lists containing this project

README

        

napi
====
N-API C Interop for Kotlin/Native

## Installation

```sh
$ npm install @datkt/napi
```

## Prerequisites

* [Kotlin/Native](https://github.com/JetBrains/kotlin-native) and the
`konanc` command line program.
* [node\_api.h](https://github.com/nodejs/node/blob/master/src/node_api.h)

## Usage

```sh
## Compile a shared library with 'module.kt' and link napi.klib found in `node_modules/`

$ konanc -r node_modules/@datkt -l napi/napi -p shared -o binding module.kt ## Linux
$ konanc -r node_modules/@datkt -l napi/napi -p dynamic -o binding module.kt ## OSX

$ mv libbinding.so binding.node
$ node -e "require('./binding')"
```

> TODO

## See Also

* https://nodejs.org/api/n-api.html

## License

MIT