Online Golang Struct to TypeScript Interface Converter

Overview

Golang Struct to TypeScript Interface

Use this tool live! https://stirlingmarketinggroup.github.io/go2ts/

This tool converts Go structs to TypeScript interfaces. Paste a Go struct on the left and the TypeScript interface will be generated on the right. Custom types will be left alone for you to fix yourself. time.Time are converted to strings, because this makes sense for our use case. The "json" struct tag will change the name of the property. Any pointers or "omitempty" fields will be optional.

This uses Go compiled to web assembly, so sorry IE users. But not really.

Because this is all done with wasm, that means we have no server costs, not even lambda functions! It also means we aren't storing or logging anyone's requests in any way.

Other tools

Those two tools approach this the same way. In fact, one is a fork of the other. Both use Go generation to generate your tagged stucts and convert them to typescript interfaces.

This tool, however, doesn't use Go generation. Instead, we use go/parser to parse the provided go into a syntax tree, and then we loop through the StructType nodes within the tree to generate our typescript. Doing it this way allows us to convert any struct to typescript via the browser, vs having to tag our structs and generate them all each time. I'm sure their libraries are extremely useful in their workflow, but personally, we like to be a little less coupled than that.

You might also like...

JSON Struct is a vocabulary that allows you to annotate and validate JSON documents.

JSON-Struct JSON Struct is a vocabulary that allows you to annotate and validate JSON documents. Examples Basic This is a simple example of vocabulary

May 8, 2022

A transpiler from golang's type to typescript's type for collaboration between frontend & backend.

A transpiler from golang's type to typescript's type for collaboration between frontend & backend.

go2type go2type.vercel.app (backup site) A typescript transpiler that convert golang's type to typescript's type. Help front-end developer to work fas

Sep 26, 2022

A template to use GoLang Lorca package to make desktop applications using webview and Svelte for the frontend,

Svelte Lorca Template A starter project for building modern cross-platform desktop apps in Go, HTML, and Svelte. This project is a fork of lorca-ts-re

Jun 19, 2022

Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized dracula theme vscode extension for flutter, web, electron and golang development.

Optimized Dracula Theme A color theme inspired by dracula color theme. This color theme is not based on dracula color theme. The color styles are simi

Jul 11, 2022

The simplest implementation of Golang channels, selects and wait groups

The simplest implementation of Golang channels, selects and wait groups

TypeScript Channels The simplest implementation of Golang channels, selects and wait groups Installation You can use one of the following package mana

Dec 8, 2022

sistema de bate ponto para os aprendizes da brisa, usando Angular no frontend, golang no backend e postgresql como banco.

Migule Points Este projeto tem o intuito de automatizar a frequência dos aprendizes da brisanet, usando Angular no front, Golang no backend e postgres

Sep 26, 2022

NXPayload Converter is a program that allows you to create boot.dat files from Nintendo Switch payload files (.bin)

NXPayload Converter is a program that allows you to create boot.dat files from Nintendo Switch payload files (.bin)

🚀 NXPayload Converter NXPayload Converter is a program that allows you to create boot.dat files from Nintendo Switch payload files (.bin) If you have

Dec 22, 2022

Hierarchical Converter for Array of Objects

Conversor Hierárquico para Array de Objetos - Hierarchical Converter to Array of Objects Docker-compose Cria a interface network e containers indicado

Jan 27, 2022

Kyrgyz / Kazakh numbers-to-words converter

Kyrgyz / Kazakh numbers-to-words converter

Mar 12, 2022

Doblar - a fully local image converter that runs in your browser

Doblar - a fully local image converter that runs in your browser

Doblar is a fully local image converter that runs in your browser. Doblar is purely client side: nothing is uploaded to a server or anything like that. All conversions take place in your browser, which means your files never leave your computer.

Dec 17, 2022

Tool for generating multidensity drawable on android project with webp converter support

Tool for generating multidensity drawable on android project with webp converter support

Tool for generating multidensity drawable on android project with webp converter support

Mar 19, 2022

.properties file parser, JSON converter and Webpack loader.

properties-file .properties file parser, JSON converter and Webpack loader. Installation 💻 ⚠ in June 2022 we have released version 2 of this package

Dec 15, 2022

The JavaScript currency converter plugin

The JavaScript currency converter plugin

currencyConverter - javascript currency converter Compatibility IE9 and up, Edge, iOS Safari 6+, Chrome 8+, Firefox 6+ Usage The currencyConverter Ins

Nov 26, 2022

Small PNG to WEBP converter, terminal based and handy for a frontend developer :D

Image Utils A small util i used while making antstack.com What does it do and how to use? It basically converts .png files to .webp Read about Webp he

Aug 24, 2022

A chat logs online saver for discord bots to save messages history & cleared messages online

A chat logs online saver for discord bots to save messages history & cleared messages online

Chat Logs NPM package that saves messages online to view it later Useful for bots where users can save messages history & cleared messages online Supp

Dec 28, 2022

:bar_chart: Re-usable, easy interface JavaScript chart library based on D3.js

:bar_chart: Re-usable, easy interface JavaScript chart library based on D3.js

billboard.js is a re-usable, easy interface JavaScript chart library, based on D3 v4+. The name "billboard" comes from the famous billboard chart whic

Jan 1, 2023

Text-based user interface CSS library

Text-based user interface CSS library

TuiCss Text-based user interface CSS library -- Documentation -- About TuiCss is a library focused to create web applications using an interface based

Jan 2, 2023

Geokit - is a command-line interface (CLI) tool written in javascript, that contains all the basic functionalities for measurements, conversions and operations of geojson files.

Geokit Geokit is a command-line interface (CLI) tool written in javascript, that contains all the basic functionalities for measurements, conversions

Nov 17, 2022
A Sequelize web builder interface. To make your own sequelize schema

A Sequelize web builder interface. To make your own sequelize schema

Ulysse 5 Mar 9, 2022
A simple server application that allows you to perform Wake-on-LAN remotely with a web interface

WoL Helper A simple server application that allows you to perform Wake-on-LAN remotely with a web interface. Usage Install: npm install -g wol-helper

Hongbo 5 Jul 27, 2022
TypeScript with a Borrow Checker. Multi-threaded, Tiny binaries. No GC. Easy to write.

TypeScript with a Borrow Checker. Multi-threaded, Tiny binaries. No GC. Easy to write.

David Alsh 1.4k Dec 19, 2022
Type-Safe Errors for JS & TypeScript

Type-Safe Errors for JS & TypeScript

Gio 1.4k Jan 6, 2023
Shikimori.ts - JavaScript & TypeScript wrapper for shikimori.one

shikimori.ts shikimori.ts - JavaScript & TypeScript wrapper for shikimori.one Features Full TypeScript support Support all platforms Easy to use Table

null 5 Sep 15, 2022
A simple bot for Lingos exercises automation written entirely in Typescript.

Linger The spiritual successor to lingus Stack used Typescript SWC Yarn Nodejs Puppeteer Dotenv UUID Nodemon Instalation Prerequisites: Nodejs: ^16.13

TlenDev 2 May 9, 2022
An implementation of cellular automata in TypeScript

?? cellular-automata An implementation of cellular automata in TypeScript. ?? Usage First of all, clone the repository: $ git clone [email protected]:aro

Faye's Games 2 Feb 7, 2022
Typescript template for a discord bot using discord.js

Discord-Typescript-Template Typescript template for a discord bot using discord.js. Installation Clone the repository git clone https://github.com/Ami

null 2 Oct 17, 2022
ThinkMore Forum frontend build with Next.js, Typescript, Redux, Jest, Sass, MUI.

ThinkMoreForum-Frontend Website Desktop Mobile Front-end technology stack Next.js Redux Typescript MUI Axios Husky React testing-library Jest Eslint,

Alan 151 Dec 10, 2022
Max is a Typescript-based Discord bot with many functionalities

Max is a Typescript-based Discord bot with many functionalities. He is both my learning curve for understanding Discord's API as well as my current passion project.

Jack Levreau 4 May 24, 2022