Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go js

JavaScript virtual machine inside Golang (using V8)

Example of usage:

js, err := gojs.New(1) // use 1 thread
if err != nil {
    fmt.Println(err)
    return
}

defer js.Dispose()

err = js.Compile("my.js", "2 + 2")
if err != nil {
    fmt.Println(err)
    return
}

res, err := js.Run("my.js")
if err != nil {
    fmt.Println(err)
    return
}

defer res.Dispose()

val, err := res.ToInt()
if err != nil {
    fmt.Println(err)
    return
}

fmt.Printf("%T, %d\n", val, val) // int64, 4

About

JavaScript virtual machine inside Golang (using V8)

Topics

Resources

Stars

4 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages