How to Auto Generate JavaScript code using GO

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

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • 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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

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