8000 GitHub - fabien0102/go2dts: A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`

Notifications You must be signed in to change notification settings

fabien0102/go2dts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go2dts

logo

A simple cli-tools to transform golang struct and const to typescript interface and type

Installation

npm i -g go2dts

Usage

go2dts <goLangDirs ...> <typescriptFile>

Testing and developing

Just put your golang file into __tests__/inputs and it will be parse each time you execute npm test or npm start.

npm start is more quick, so perfect to add some console.log and improve the parsing.

npm test --watch generate a snapshot, so you can just update this one to the expecting state and start coding to have everything green #TDDStyle

Know issues

  • The type mapping is incomplete (I'm not a golang developper, so I add types when I discover them)
  • This library will not follow the import dependencies, so the output types can be broken

About

A simple cli-tools to transform golang `struct` and `const` to typescript `interface` and `type`

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  
0