Codeverter is a tool to convert a TypeScript source file (*.ts) into different languages (go, c# or Visual Basic by the moment).
If you want to try it, click here!
npm install -g @southworks/codeverter
cd ./path-to-codeverter
npm run build:prod
npm install -g
- Install Node.js which includes Node Package Manager
In order to build the project you must install the required dependencies by running the following command npm install
The project is written in TypeScript so you need to call the tsc compiler. To start the compilation process use the command npm run build
once finished you will have all the final JavaScript files at ./out folder.
For production use the command npm run build:prod
To run the available test suites run the command npm test
- The test framework is Jest so you can use any flag you want. For example:
npm test -- -t "constant"
cdv
is the command to execute the tool
For example:
cdv --src xxx --lang zzz --dest yyy <path>
--src
: Path to the source file or directory.
- Default value: .
--lang
: Target language.
- Values: csharp | go | vb
- Default value: go
--template
: Custom template to perform the transformation. The extension must be '.t' followed by the language extension, for example: csharp => .tcs.
- Values: Path to the custom tempate
- Default value: ''
--dest
: Destination
- Values: console | file
-
- file has an extra parameter <destination path>
- Default value: console
Fully documented support at Wiki
C# | GO | Visual Basic | |
---|---|---|---|
Global | ✔️ | ✔️ | ✔️ |
Function/Constructor body | ✔️ | ✔️ | ✔️ |
C# | GO | Visual Basic | |
---|---|---|---|
Numeric | ✔️ | ✔️ | ✔️ |
String | ✔️ | ✔️ | ❌ |
Implicit | ✔️ | ✔️ | ✔️ |
C# | GO | Visual Basic | |
---|---|---|---|
Members | ✔️ | ❌ | ✔️ |
Method/Functions | ✔️ | ✔️ | ✔️ |
Inheritance | ✔️ | ❌ | ✔️ |
Implementation | ✔️ | ✔️ | ✔️ |
C# | GO | Visual Basic | |
---|---|---|---|
Inheritance | ✔️ | ✔️* | ✔️ |
Interfaces | ✔️ | ✔️ | ✔️ |
Visibility | ✔️ | ✔️** | ✔️ |
Static | P | P |
*In a go way, using composition
**Using naming conventions
C# | GO | Visual Basic | |
---|---|---|---|
Visibility | ✔️ | ❌ | ✔️ |
Parameters | ✔️ | ✔️ | ✔️ |
Body | AS COMMENT | AS COMMENT | AS COMMENT |
C# | GO | Visual Basic | |
---|---|---|---|
Visibility | ✔️ | ✔️* | ✔️ |
*Naming convention for pubic or private, protected is considered private
C# | GO | Visual Basic | |
---|---|---|---|
Visibility | ✔️ | ✔️* | ✔️ |
Parameters | ✔️ | ✔️ | ✔️ |
Return type | ✔️ | ✔️ | ✔️** |
Default return value | ✔️ | ✔️ | ✔️** |
*Naming convention for pubic or private, protected is considered private
**As functions