New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

golang-node

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

golang-node

Write Golang code inside NodeJS

  • 0.0.7
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Requirements

  • NodeJS > 8.5.0

Features

  • Download custom Go compiler, no need to have Go installed
- AUTOMATIC DOWNLOAD IS NOT SET YET, YOU WILL NEED TO DOWNLOAD 
- THE PROPER GO COMPILER AND COPY IT UNDER "compilers" FOLDER AND 
- CHANGE THE Go FOLDER'S NAME TO THE PLATFORM NAME 
- (windows_64 or linux_64 for example)
  • Automatically "go get" all imported packages

Example

Compile program:

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!!"

FAQs

Package last updated on 05 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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