Skip to content

Commit

Permalink
chore: README
Browse files Browse the repository at this point in the history
  • Loading branch information
X3ZvaWQ committed Jan 26, 2024
1 parent d09e469 commit 1ba90a7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ To initialize, create a new Lua state, register the standard library, set a glob
```js
const { Lua } = require('wasmoon-lua5.1');

// Initialize a new lua environment factory
// You can pass the wasm location as the first argument, useful if you are using wasmoon on a web environment and want to host the file by yourself
// create lua global (also a wasm instance)
const lua = await Lua.create();
// Create a standalone lua environment from the factory

try {
// get context, a proxy. It will be used to interact with lua conveniently
const ctx = lua.ctx;
ctx.add = (a, b) => a + b;
console.log(ctx.add(114514, 1919810));
Expand Down

0 comments on commit 1ba90a7

Please sign in to comment.