# How to understand relationship between wasm file and wasi js file

**URL:** <https://discuss.tvm.apache.org/t/how-to-understand-relationship-between-wasm-file-and-wasi-js-file/11943>\
**Category:** Questions\
**Created:** [January 18, 2022, 2:55am UTC](https://discuss.tvm.apache.org/t/how-to-understand-relationship-between-wasm-file-and-wasi-js-file/11943 "2022-01-18T02:55:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roderick](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/roderick/32/3512_2.png) [@roderick](https://discuss.tvm.apache.org/u/roderick)\
**Post date:** [January 18, 2022, 2:55am UTC](https://discuss.tvm.apache.org/t/how-to-understand-relationship-between-wasm-file-and-wasi-js-file/11943/1 "2022-01-18T02:55:47Z")

</div>

I’m learning how to use call tvm using javascript under the web sub-directory. When reading the following two examples:

1. web/tests/node/test\_packed\_func.js

```auto
const EmccWASI = require(path.join(wasmPath, "tvmjs_runtime.wasi.js"));
const wasmSource = fs.readFileSync(path.join(wasmPath, "tvmjs_runtime.wasm"));

let tvm = new tvmjs.Instance(
  new WebAssembly.Module(wasmSource),
  new EmccWASI()
);

```

1. web/tests/node/test\_module\_load.js

```auto
const EmccWASI = require(path.join(wasmPath, "tvmjs_runtime.wasi.js"));
const wasmSource = fs.readFileSync(path.join(wasmPath, "test_addone.wasm"));

const tvm = new tvmjs.Instance(
  new WebAssembly.Module(wasmSource),
  new EmccWASI()
);

```

From the makefile, \*.cc → \*.bc → tvmjs\_runtime.wasm → tvmjs\_runtime.js → tvmjs\_runtime.wasi.js .

In my think, the tvmjs\_runtime.wasm is needed by all example (PackedFunc, Module implement in this wasm file). But when look at the second example, the tvmjs\_runtime.wasm not loaded, that confused me – where’s the TVM functionality come from? If tvmjs\_runtime.wasm is not necessary, why it is loaded in the fist example.
