Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dop251/goja_nodejs
Nodejs compatibility library for Goja
https://github.com/dop251/goja_nodejs
Last synced: 2 days ago
JSON representation
Nodejs compatibility library for Goja
- Host: GitHub
- URL: https://github.com/dop251/goja_nodejs
- Owner: dop251
- License: mit
- Created: 2016-11-11T18:14:31.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-07-28T17:06:25.000Z (5 months ago)
- Last Synced: 2024-12-19T03:03:37.799Z (10 days ago)
- Language: Go
- Size: 74.2 KB
- Stars: 344
- Watchers: 9
- Forks: 81
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Nodejs compatibility library for Goja
====This is a collection of Goja modules that provide nodejs compatibility.
Example:
```go
package mainimport (
"github.com/dop251/goja"
"github.com/dop251/goja_nodejs/require"
)func main() {
registry := new(require.Registry) // this can be shared by multiple runtimesruntime := goja.New()
req := registry.Enable(runtime)runtime.RunString(`
var m = require("./m.js");
m.test();
`)m, err := req.Require("./m.js")
_, _ = m, err
}
```More modules will be added. Contributions welcome too.