TiLied.CSTOJS_CLI 0.1.4

dotnet tool install --global TiLied.CSTOJS_CLI --version 0.1.4
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local TiLied.CSTOJS_CLI --version 0.1.4
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=TiLied.CSTOJS_CLI&version=0.1.4
                    
nuke :add-package TiLied.CSTOJS_CLI --version 0.1.4
                    

CSTOJS_CLI

Dotnet tool | Core library | Website | Try it online!

This dotnet tool/CLI is a "front-end" that implements a "core" library CSharpToJavaScript translator, converter, transpiler, transcompiler, compiler, source-to-source compiler, you name it. CLI inspired (a little) by Meson, but it should behave like the dotnet cli and tsc cli.

Quick start

To install:

dotnet tool install --global TiLied.CSTOJS_CLI

To use:

cstojs-cli setup "Output"
cstojs-cli translate

To update:

dotnet tool update --global TiLied.CSTOJS_CLI

To delete:

dotnet tool uninstall --global TiLied.CSTOJS_CLI

In-depth start

  • Dotnet 10 required.
  • To install dotnet tool globally run:
dotnet tool install --global TiLied.CSTOJS_CLI
  • Make a new directory "Test". Inside that directory, run:
cstojs-cli setup "Output"
    • The command executes:
      • dotnet new console -f net10.0
      • dotnet add package CSharpToJavaScript
      • Creating "Output" folder
      • Creating "cstojs_options.xml"
    • Structure will be:
- obj
- Output
- cstojs_options.xml
- Program.cs
- Test.csproj
    • "Output" folder is where the translated JS files will be.
    • "cstojs_options.xml" is project options, see below for an example.
  • To translate "Program.cs", run:
cstojs-cli translate
    • The "Output" folder will contain a translated "Program.js" file.
  • To add a new CS file, add <File Source="./Test.cs" /> to "cstojs_options.xml" and run "cstojs-cli translate" again.
  • To update, run:
dotnet tool update --global TiLied.CSTOJS_CLI
  • To delete, run:
dotnet tool uninstall --global TiLied.CSTOJS_CLI

cstojs_options.xml

<ProjectOptions>
  
  <Output Folder="Output" />

  
  <DefaultOptions>
    
    <Option NormalizeWhitespace="true" />
  </DefaultOptions>

  
  <File Source="./Program.cs" />

  
  <File Source="./Test.cs">
     
    <Option Debug="true" />
  </File>

</ProjectOptions>

Tutorials/Examples

More on a website

Commands

Run subcommands with -h to get more information.

setup <folder>  Setup cstojs project.
translate       Translate specified files in 'cstojs_options.xml'.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
0.1.4 174 12/22/2025
0.1.3 237 12/15/2025
0.1.2 423 12/8/2025
0.1.1 197 11/25/2025
0.1.0 198 9/29/2025