这是indexloc提供的服务,不要输入任何密码
Skip to content

u5surf/gojis

 
 

Gojis

Build Status Codacy Badge Quality Gate Status

Buy Me A Coffee

Gojis is an implementation of ECMAScript 2018 (ES 9). It basically is a JavaScript VM, just like Goja or Otto. The documentation can be found here.

Why

Goja and Otto are both stuck at implementing most features of ES 5.1. This implementation aims to support ES 9, and, after that maybe even ES 10 (not released as of 2019-06-27) and later.

What is this Gojis VM good for?

The Gojis VM can be run as a standalone, or you can embed it into your Go application by using the API. Go get it with

go get -u github.com/gojisvm/gojis

and start using it with

// FIXME: the API is in draft mode, this is subject to change at any time

vm := gojis.NewVM()

vm.SetFunction("greet", func(gojis.Args) gojis.Object {
    vm.Eval(`console.log("Hello World!");`)
    return nil
})

vm.Eval(`greet();`)
/*
    prints:
    Hello World!
*/

For more documentation, please have a look at the API documentation.

What are the goals?

The primary goal of this project is to have fun coding, as I love to code, but thinking about system designs and architectures is difficult. The ECMAScript language specification (which can be found in /docs), takes care of most of these things already, so a contributor can really focus on implementation and optimization.

Another goal I am trying to achieve is, to provide the Go community with a JavaScript VM that supports at least ES 6 features. Goja and Otto are both stuck at implementing ES 5.1, but this implementation does exactly that.

Current status

There is a milestone to keep track of the implementation progress of ES 9.

About

An ECMAScript 2018 (ES9) implementation in Go

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%