How to Auto Generate JavaScript code using GO

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • Scout APM - Less time debugging, more time building
  • SonarLint - Clean code begins in your IDE with SonarLint
  • SaaSHub - Software Alternatives and Reviews
  • goprotobuf

    Go support for Google's protocol buffers (by golang)

    In this case try approach with line by line generation. Very much like what protoc-gen-go does for Go code: https://github.com/golang/protobuf/blob/ae97035608a719c7a1c1c41bed0ae0744bdb0c6f/protoc-gen-go/grpc/grpc.go#L142, need to implement this kind of generator yourself.

  • protobuf

    I wrote a generator similar to the one for go grpc for typescript protobufs: https://github.com/MemeLabs/protobuf/blob/main/pkg/pgsutil/generator.go. The implementation handles a lot of the details like name formatting: https://github.com/MemeLabs/protobuf/blob/main/cmd/ts/ts.go. And the output is legible enough without it but you could always run prettier on the result: https://github.com/MemeLabs/protobuf/blob/main/src/apis/strims/rpc/rpc.ts.

  • Scout APM

    Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts