0.1.10 • Published 6 years ago

golang-node v0.1.10

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

golang-node

Execute Go code from NodeJS

Golang code compiles so fast, but may be not worth if the Go program task is not too intensive for NodeJS. In the other case, if you need to make a high intensive task, you may want to do it in Go.

ToDO

  • Testing in different Go environments (with and without golang installed)
  • Develop more platforms (now only working for linux_64 and windows_64)

Requirements

  • NodeJS > 8.5.0

Features

  • Download custom Go compiler, no need to have Go installed
  • Automatically "go get" all imported packages

Example

Compile program:

const Go = require("golang-node");

const name = "World";
const code = await Go`
package main

import "fmt"

func main(){
    fmt.Println("Hello ${name} from Golang!!")
}
`;

then execute it and get the result:

const res = await code.run();
console.log(res);
// ""Hello World from Golang!!"
0.1.10

6 years ago

0.1.9

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.2

6 years ago