Skip to content

My fork of the Nodejs compatibility library for Goja to add it a http module

License

Notifications You must be signed in to change notification settings

cedrick-ah/go-http-js

 
 

Repository files navigation

Nodejs compatibility library for Goja

This is a collection of Goja modules(from goja_nodejs + a http module that I added here because a was not able to add it there) that provide nodejs compatibility.

Example:

package main

import (
	"github.com/dop251/goja"
	"github.com/dop251/goja_nodejs/console"
	"github.com/dop251/goja_nodejs/http"
	"github.com/dop251/goja_nodejs/require"
)

func main() {
	registry := new(require.Registry)

    runtime := goja.New()
	registry.Enable(runtime)
    http.Enable(runtime)
	console.Enable(runtime)

	runtime.RunString(`
		var data = http.get("https://www.google.com");
		console.log(data);
    `)
}

About

My fork of the Nodejs compatibility library for Goja to add it a http module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.1%
  • JavaScript 1.9%