{"_id":"@antonz/runno","name":"@antonz/runno","dist-tags":{"latest":"0.6.1"},"versions":{"0.6.1":{"name":"@antonz/runno","version":"0.6.1","description":"Runno WASI runtime.","author":{"name":"Ben Taylor","email":"runno@taybenlor.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/nalgeon/runno.git"},"type":"module","main":"./dist/runno.mjs","devDependencies":{"esbuild":"^0.19.11","typescript":"^5.1.6"},"scripts":{},"_id":"@antonz/runno@0.6.1","bugs":{"url":"https://github.com/nalgeon/runno/issues"},"homepage":"https://github.com/nalgeon/runno#readme","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-ioM0x0ZI42avZqKdaY2ETJnI30kQPNL/UbuFxNdW9guFepHSQU5NkOKorqIR7tG7KSln3lgZRwhJj2BC7WjhIg==","shasum":"1f804fd7132005f124e9ae8bf8c31236c422a0d0","tarball":"https://registry.npmjs.org/@antonz/runno/-/runno-0.6.1.tgz","fileCount":5,"unpackedSize":58139,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMLkZhSLhTdnsdzLeQMBn8b4lnsg3ItxSf9CRyg1av/AiA/c3JmijtymPhsEgGoKOn6LxqONQaT75yvw290DkBj1Q=="}]},"_npmUser":{"name":"antonz","email":"m@antonz.org"},"directories":{},"maintainers":[{"name":"antonz","email":"m@antonz.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/runno_0.6.1_1704227307688_0.14110253803440354"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-02T20:28:27.602Z","0.6.1":"2024-01-02T20:28:27.875Z","modified":"2024-01-02T20:28:28.246Z"},"maintainers":[{"name":"antonz","email":"m@antonz.org"}],"description":"Runno WASI runtime.","homepage":"https://github.com/nalgeon/runno#readme","repository":{"type":"git","url":"git+https://github.com/nalgeon/runno.git"},"author":{"name":"Ben Taylor","email":"runno@taybenlor.com"},"bugs":{"url":"https://github.com/nalgeon/runno/issues"},"license":"MIT","readme":"# Runno WASI runtime\n\n> This is a simplified version of the [`@runno/wasi`](https://www.npmjs.com/package/@runno/wasi) runtime.\n\nThis package allows you to run WASI binaries on the web with an emulated\nfilesystem. If the binary receives calls to stdin/out/err then you get callbacks\nyou'll need to handle. In future there may be other callbacks to intercept\ninteresting system level events, or hooks into the filesystem.\n\n## Quickstart\n\nThe quickest way to get started with Runno is by using the `WASI.start` class\nmethod. It will set up everything you need and run the Wasm binary directly.\n\nBe aware that this will run on the main thread, not inside a worker. So you will\ninterrupt any interactive use of the browser until it completes.\n\n```html\n<script src=\"https://unpkg.com/@antonz/runno/dist/runno.js\"></script>\n```\n\n```js\nconst { WASI } = window.Runno;\n\n//...\n\nconst result = WASI.start(fetch(\"/binary.wasm\"), {\n    args: [\"binary-name\", \"--do-something\", \"some-file.txt\"],\n    env: { SOME_KEY: \"some value\" },\n    stdout: (out) => console.log(\"stdout\", out),\n    stderr: (err) => console.error(\"stderr\", err),\n    stdin: () => prompt(\"stdin:\"),\n    fs: {\n        \"/some-file.txt\": {\n            path: \"/some-file.txt\",\n            timestamps: {\n                access: new Date(),\n                change: new Date(),\n                modification: new Date(),\n            },\n            mode: \"string\",\n            content: \"Some content for the file.\",\n        },\n    },\n});\n```\n\n_Note: The `args` should start with the name of the binary. Like when you run\na terminal command, you write `cat somefile` the name of the binary is `cat`._\n\n## The filesystem\n\n`@runno/wasi` internally emulates a unix-like filesystem (FS) from a flat\nstructure. All files must start with a `/` to indicate they are in the root\ndirectory. The `/` directory is preopened by `@runno/wasi` for your WASI binary\nto use.\n\nPaths provided to the FS can include directory names `/like/this.png`. The FS\nwill treat files with the same prefix `/like/so.png` as if they are in the same\nfolder. Any folders created will contain an empty `.runno` file `/like/.runno`\nas a placeholder.\n\nWASI has a complex permissions system that is entirely ignored. All files you\nprovide can be accessed by the WASI binary, with all permissions.\n\n## Which WASI standards are supported?\n\nCurrently `@runno/wasi` supports running only `unstable` and `snapshot-preview1`\nWASI binaries. The `snapshot-preview1` standard is more recent, and preferred.\nAdditionally its likely some details of `unstable` have been missed. If you spot\nthese, please file a bug.\n\nOther extension standards like WASMEdge, and WASIX are currently not supported,\nbut could be. WASI Modules are also not supported, but I'm interested in\nlearning more about them.\n\n## License\n\nCopyright 2023 [Ben Taylor](https://taybenlor.com/).\n\nThe software is available under the MIT license.\n","readmeFilename":"README.md"}