Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A library for translating/converting cs into js, using Roslyn.

License

TiLied/CSharpToJavaScript

Repository files navigation

CSharpToJavaScript

Nuget package | CLI | Website | Try it online!

This library is a "core" where all the "magic" happens for translating/converting cs into js, using Roslyn. You should use the CLI/dotnet tool, it behaves more or less like dotnet cli, tsc cli, meson. Look for the implementation in CLI, BWA app or simple "Hello world" below.

Hello world

FileData file = new()
{
	SourceStr = @"Console.WriteLine(""Hello world."");"
};
FileData[] files = CSTOJS.Translate([ file ]);
Console.WriteLine(files[0].TranslatedStr);
  • Run a program
  • Console output should be:
console.log("Hello world.");
  • For options look at the code or on a website.
  • To specify options (options applying per file):
FileData file = new()
{
	OptionsForFile = new(){ Debug = true },
	...
};
...

Related Repository

About

A library for translating/converting cs into js, using Roslyn.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /