# WASI

In this use-case we wish to use a JavaScript program to invoke a WebAssembly module that further invokes native "OS" functionality. In other words, we wish to implement the following call chain:

![](https://2868056221-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLK7psSFFfaEwdrQS6L%2Fsync%2Fe5c4d36145becffc004914c319276f3805527a43.png?generation=1604525166469874\&alt=media)

JavaScript has native support for WebAssembly, but without a tool such as the WebAssembly System Interface ([`WASI`](https://github.com/webassembly/wasi)), a WebAssembly module does not normally have access to any OS-level functionality.

Within the context of a JavaScript runtime environment, WASI functionality must be provided by means of a set of JavaScript polyfills — and this is the role of Wasmer-js.

![](https://2868056221-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLK7psSFFfaEwdrQS6L%2Fsync%2Fcbc23c27a0844d5c94cc48dd66ad119c84c1b8b1.png?generation=1604525165910859\&alt=media)

{% hint style="warning" %}

## Important

The JavaScript environment shown here could either be on the client (within a browser), or on the server (provided by Node.js).\
Either way, the native functions invoked from WebAssembly via Wasmer-JS and WASI belong to the JavaScript runtime environment, not the underlying operating system.
{% endhint %}
