Coder Social home page Coder Social logo

0xdaksh / node-golang Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 4.0 17 KB

๐Ÿ’€ Golang bridge for Node.js, Run Golang On Node; Yay!

Home Page: https://www.npmjs.com/package/golang

License: MIT License

JavaScript 100.00%
nodejs golang run go with node

node-golang's Introduction

๐Ÿ’€ Golang for Node.

Build Status

Golang bridge for Node.js, eventually allowing you to run Golang code just directly from Node!

Installation

npm install --save golang

Pre-Requistes

You'd need a go-lang compiler, Download it from Here

API with Examples

Run

Params:

  • Input

Does:

  • Creates a File
  • Runs it
  • Output is logged out.
	var golang = require('golang')
	golang.run(`
		package main
		import "fmt"
		func main() {
		    fmt.Println("hello world")
		}
	`).then(() => {
		// output on the terminal
	}).catch(err => {
		throw err; // err code. 
	})

Build

Params:

  • Input

Does:

  • Creates a File.
  • Builds it from the File.
  • Loggs the url of the Build File.
	var golang = require('golang')
	golang.build(`
		package main
		import "fmt"
		func main() {
		    fmt.Println("hello world")
		}
	`).then(() => {
		// output on terminal + directory of build
	}).catch((e) => {
		throw e // err code.
	})

๐Ÿ’€ Contributions

Want to Improve it? Sure, Please Submit an Issue or a Pull Request :)

๐Ÿ“œ License

Licensed Under MIT 2017 ยฉ to Daksh Miglani, Please Give Credit when used :)

node-golang's People

Contributors

0xdaksh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

node-golang's Issues

Could use command line functionality

use case is running a small golang program as part of the build-deploy process in a nodejs application.

Would like to add:

"scripts":{
    "sign":"golang ./some_tool/tool.go input_to_go input_to_go"
}

in my package.json.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.