Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme Module section update #1587

Merged
merged 1 commit into from
Jul 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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