Skip to content

Commit

Permalink
Readme Module section update (#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zmarfan authored Jul 9, 2023
1 parent db73cad commit 43b6356
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ By default, the module resolution algorithm will be restricted to the base path
Defining modules using JavaScript source code:

```c#
engine.CreateModule("user", "export const name = 'John';")
engine.AddModule("user", "export const name = 'John';");

var ns = engine.ImportModule("user");

Expand All @@ -390,13 +390,13 @@ Defining modules using the module builder, which allows you to export CLR classe

```c#
// Create the module 'lib' with the class MyClass and the variable version
engine.CreateModule("lib", builder => builder
engine.AddModule("lib", builder => builder
.ExportType<MyClass>()
.ExportValue("version", 15)
);

// Create a user-defined module and do something with 'lib'
engine.CreateModule("custom", @"
engine.AddModule("custom", @"
import { MyClass, version } from 'lib';
const x = new MyClass();
export const result as x.doSomething();
Expand Down

0 comments on commit 43b6356

Please sign in to comment.