FiloSottile / FiloSottile/mkcert
wasm binary?
- Dominant language
- Go
- Stars
- 59.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
Is there any chance of compiling this code to a wasm binary that can be imported into nodejs and deno projects? I want to use `mkcert` to generate localhost certificates for a local web app package, but it will require end users to install `mkcert` themselves, and run commands. If `mkcert` were usable as a wasm binary (literally just expose the command line interface as a function in js) then local web apps could ship with mkcert as a dependency and install the root CA and generate the localhost certs themselves as part of the initialization process.
An example of what initializing mkcert as a wasm module might look like:
```ts
const wasmCode = await Deno.readFile("mkcert.wasm");
const wasmModule = new WebAssembly.Module(wasmCode);
const wasmInstance = new WebAssembly.Instance(wasmModule);
const mkcert = wasmInstance.exports.main as CallableFunction;
await mkcert('-install');
await mkcert('localhost 127.0.0.1');
```
Contributor guide
Assessment
This issue has not been assessed yet.