You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Application API reference
13
13
All of the other JavaScript YoWASP packages use the common runtime functionality implemented here. They export the function `runX` where `X` is the name of the application, which can be called as:
- The `filesOut` return value is the same kind of object as `filesIn`, representing the state of the virtual filesystem after the application terminated. It contains all of the data provided in `filesIn` as well, unless these files were modified or removed by the application.
23
23
24
24
Options:
25
-
- The `stdin(byteLength)` option is a function that is called with a number of bytes the application requests from the standard input. It must return an `Uint8Array` of up to the requested number of bytes in length, or `null` to indicate an end-of-file condition. Whether a stream that has indicated an end-of-file condition will ever be read from again is application-specific.
26
-
- The `stdout(bytes)` and `stderr(bytes)` options are functions that are called with a sequence of bytes the application prints to the standard output and standard error streams respectively, or `null` to indicate that the stream is being flushed. If specified as `null`, the output on that stream is ignored. By default, each line of text from the combined streams is printed to the debugging console.
27
-
- The `decodeASCII` option determines whether the values corresponding to files in `filesOut` are always instances of [Uint8Array][] (if `decodeASCII: false`), or whether the values corresponding to text files will be strings (if `decodeASCII: true`). A file is considered a text file if it contains only bytes `0x09`, `0x0a`, `0x0d`, or those in the range `0x20` to `0x7e` inclusive. The default is `decodeASCII: true`.
28
-
- The `fetchProgress({ source, totalLength, doneLength })` option provides a callback to monitor download progress. The `source` is the `Application` object whose assets are being downloaded; `totalLength` and `doneLength` are in bytes. Note that if the server does not send the `Content-Length` header for *any* of the assets, `totalLength` will be `NaN`. By default, download progress is printed to the debugging console.
25
+
- The `stdin(byteLength)` option is a function that is called with a number of bytes the application requests from the standard input. It must return an `Uint8Array` of up to the requested number of bytes in length, or `null` to indicate an end-of-file condition. Whether a stream that has indicated an end-of-file condition will ever be read from again is application-specific. By default, the standard input always indicates an end-of-file condition.
26
+
- The `stdout(bytes)` and `stderr(bytes)` options are functions that are called with a sequence of bytes the application prints to the standard output and standard error streams respectively, or `null` to indicate that the stream is being flushed. If specified as `null`, the output on that stream is ignored. By default, each line of text from the combined stdout and stderr streams is printed to the debugging console.
27
+
- The `decodeASCII` option determines whether the values corresponding to files in `filesOut` are always instances of [Uint8Array][] (if `decodeASCII: false`), or whether the values corresponding to text files will be strings (if `decodeASCII: true`). A file is considered a text file if it contains only bytes `0x09`, `0x0a`, `0x0d`, or those in the range `0x20` to `0x7e` inclusive. By default, text files are decoded to strings.
28
+
- The `fetchProgress({ source, totalLength, doneLength })` option provides a callback to monitor download progress. The `source` is an opaque object denoting the application whose assets are being downloaded; `totalLength` and `doneLength` are in bytes. Note that the byte counts are for uncompressed data even if the actual transfer is made using HTTP compression (via the `Accept-Encoding` mechanism). By default, download progress is printed to the debugging console.
29
29
30
30
If the application returns a non-zero exit code, the exception `Exit` (exported alongside the `runX` function) is raised. This exception has two properties:
31
31
- The `code` property indicates the exit code. (Currently this is always 1 due to WebAssembly peculiarities.)
0 commit comments