Skip to content
This repository was archived by the owner on Jul 18, 2022. It is now read-only.
/ go-node-ffi Public archive

[INACTIVE] An experiment using Go 1.5 buildmode to compile shared C libraries, and to subsequently access them through NodeJS bindings via node-ffi. Compatible with Go 1.9, and Node 7.

License

Notifications You must be signed in to change notification settings

MrSaints/go-node-ffi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

98cf01d · Dec 13, 2017

History

10 Commits
Dec 13, 2017
Dec 13, 2017
Aug 26, 2015
Dec 13, 2017
Dec 13, 2017
Aug 24, 2015
Dec 13, 2017
Dec 13, 2017
Dec 13, 2017
Dec 13, 2017
Dec 13, 2017

Repository files navigation

go-node-ffi

An experiment using Go 1.5 buildmode to compile shared C libraries, and to subsequently access them through NodeJS bindings via node-ffi.

Simply put, let's try calling Go functions from JavaScript.

Tested with go1.9.1, and Node v7.8.0.

Installation

  1. Download, and install the package:

    go get github.com/mrsaints/go-node-ffi
  2. Install NPM dependencies:

    yarn
    
    // OR...
    npm install

Building

yarn build

// OR...
go build -buildmode=c-shared -o go-node-ffi.so

Running

Tinker with the sample file go-node-ffi.js, and run:

yarn start

// OR...
node go-node-ffi.js

Debugging

Enable verbose logging:

export DEBUG="ref,ref:struct"

Now, run the program (see above).

About

[INACTIVE] An experiment using Go 1.5 buildmode to compile shared C libraries, and to subsequently access them through NodeJS bindings via node-ffi. Compatible with Go 1.9, and Node 7.

Resources

License

Stars

Watchers

Forks

Packages

No packages published