Skip to content

Commit fa8edc9

Browse files
authored
Update README.md
1 parent 09ce699 commit fa8edc9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ This is a personal project with purpose to learn and understand better c# and js
77

88
### C#
99
```csharp
10-
using static CSharpToJavaScript.APIs.JS.GlobalObject.GlobalThis;
1110
namespace ConsoleAppTest.CSharp;
1211

1312
public class Test
1413
{
1514
public Test()
1615
{
17-
Console.Log("HelloWorld!");
16+
Console.WriteLine("HelloWorld!");
1817
}
1918
}
2019
```
@@ -38,7 +37,7 @@ class Test
3837
CSTOJS cstojs = new();
3938
await cstojs.GenerateOneAsync("FULL PATH TO CSHARP FILE YOU WHAT TO CONVERT");
4039
```
41-
- 5 Run program and file will be generated in output path(default is "Directory.GetCurrentDirectory()") with name "|FILE NAME|.js"(default)
40+
- 5 Run program and file will be generated in output path(default is "Directory.GetCurrentDirectory()") with name "|CS FILE NAME|.js"(default)
4241
- 6 See below for simple example "HelloWorld"
4342

4443
## Example "HelloWorld"
@@ -60,14 +59,17 @@ public class Program
6059
```
6160
CSharp/Test.cs
6261
```csharp
63-
using static CSharpToJavaScript.APIs.JS.GlobalObject.GlobalThis;
62+
using CSharpToJavaScript.APIs.JS;
63+
64+
using static CSharpToJavaScript.APIs.JS.GlobalObject;
65+
6466
namespace ConsoleAppTest.CSharp;
6567

6668
public class Test
6769
{
6870
public Test()
6971
{
70-
Console.Log("HelloWorld");
72+
GlobalThis.Console.Log("HelloWorld!");
7173
}
7274
}
7375
```
@@ -77,7 +79,7 @@ class Test
7779
{
7880
constructor()
7981
{
80-
console.log("HelloWorld");
82+
globalThis.console.log("HelloWorld!");
8183
}
8284
}
8385
```

0 commit comments

Comments
 (0)