CSharpToJavaScript 0.1.10
dotnet add package CSharpToJavaScript --version 0.1.10
NuGet\Install-Package CSharpToJavaScript -Version 0.1.10
<PackageReference Include="CSharpToJavaScript" Version="0.1.10" />
<PackageVersion Include="CSharpToJavaScript" Version="0.1.10" />
<PackageReference Include="CSharpToJavaScript" />
paket add CSharpToJavaScript --version 0.1.10
#r "nuget: CSharpToJavaScript, 0.1.10"
#:package CSharpToJavaScript@0.1.10
#addin nuget:?package=CSharpToJavaScript&version=0.1.10
#tool nuget:?package=CSharpToJavaScript&version=0.1.10
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.
Status
test262-parser(master): Only JS part (code is not public, yet. ES5 implemented) Total tests: 5363 | Passed: 2824 (52 %) | Failed: 2539
test262(es5 branch): Total tests: 11725 | Passed: 1272 (10 %)** | Failed: 10453
**Note: Tests run with "UseVarOverLet" option, using Jint as an engine.
Hello world
- Install nuget package or download a specific version.
- Skip this if using a Nuget package. Follow the instructions on how to add a project reference.
- In the Main method, add:
FileData file = new()
{
SourceStr = @"Console.WriteLine(""Hello world."");"
};
file = CSTOJS.Translate(file);
Console.WriteLine(file.TranslatedStr);
- Run a program
- Console output should be:
console.log("Hello world.");
FileData file = new()
{
OptionsForFile = new(){ Debug = true },
...
};
...
Related Repository
- Dotnet tool/CLI for a library: https://github.com/TiLied/CSTOJS_CLI
- Tests: https://github.com/TiLied/CSTOJS_Tests
- Library for generating various stuff: https://github.com/TiLied/CSTOJS_GenLib
- Website/documentation: https://github.com/TiLied/CSTOJS_Pages
- Blazor WebAssembly app: https://github.com/TiLied/CSTOJS_BWA
| Product | Versions 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. |
-
net10.0
- Microsoft.CodeAnalysis.CSharp (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- [Updated generated c#.](https://github.com/TiLied/CSharpToJavaScript/commit/01c432f810362b7aa2837a85be20b66eb758df30)
- [Improved this expression for real this time. part 2!](https://github.com/TiLied/CSharpToJavaScript/commit/70eeec08cc7be7a54170e2d88ebfa1b030b97297)
- [Fixed a typo.](https://github.com/TiLied/CSharpToJavaScript/commit/ad2d1efa153694047be0b1f0d53923997ee06f68)
**Full Changelog**: https://github.com/TiLied/CSharpToJavaScript/compare/0.1.9...0.1.10