{"_id":"2wasm","name":"2wasm","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.3":{"name":"2wasm","module":"index.ts","version":"0.0.3","type":"module","description":"A command-line tool to convert OpenAPI specifications into WebAssembly plugins","repository":{"type":"git","url":"git+https://github.com/micro-wasm/openapi2wasm.git"},"author":{"name":"microchipgnu"},"license":"MIT","keywords":["openapi","wasm","webassembly","extism","cli"],"engines":{"node":">=16.0.0"},"devDependencies":{"@types/bun":"latest"},"peerDependencies":{"typescript":"^5"},"dependencies":{"@extism/js-pdk":"^1.1.1","@types/fs-extra":"^11.0.4","commander":"^13.1.0","extism":"^2.0.0-rc11","fs-extra":"^11.3.0","yaml":"^2.7.1"},"bin":{"openapi2wasm":"cli.js"},"scripts":{"start":"./index.ts","build":"bun build ./index.ts --outfile cli.js --target=node --banner=\"#!/usr/bin/env node\" && chmod +x cli.js","prepublishOnly":"bun run build","test":"bun run ./index.ts build --schema sample/petstore.yaml --output ./test-output"},"_id":"2wasm@0.0.3","gitHead":"44effaa12d725b459482c9480d1320425b116d11","bugs":{"url":"https://github.com/micro-wasm/openapi2wasm/issues"},"homepage":"https://github.com/micro-wasm/openapi2wasm#readme","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-QrU4bB9h6rNewW+oddRK5PeCyb/hfddAmOoTshQrEw7nHiOcv+zUo6R2rO8efTjcjSblwMrfFPRaqCKp/EIx9g==","shasum":"55bdaee7c5f2d4d7a4a7cfd578d38ded80ee5b19","tarball":"https://registry.npmjs.org/2wasm/-/2wasm-0.0.3.tgz","fileCount":4,"unpackedSize":405703,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBD0ovY4ZuQ40mbTP2q/jszNiyLEz+3Nv6he9ySNTFvGAiEA+m9UJr6X68A5hSZcYaULIWAzInfyvtOUD209ZSUheiM="}]},"_npmUser":{"name":"microchipgnu","email":"microchipgnu@gmail.com"},"directories":{},"maintainers":[{"name":"microchipgnu","email":"microchipgnu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/2wasm_0.0.3_1744371972144_0.292152835475584"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-11T11:46:12.143Z","0.0.3":"2025-04-11T11:46:12.345Z","modified":"2025-04-11T11:46:12.611Z"},"maintainers":[{"name":"microchipgnu","email":"microchipgnu@gmail.com"}],"description":"A command-line tool to convert OpenAPI specifications into WebAssembly plugins","homepage":"https://github.com/micro-wasm/openapi2wasm#readme","keywords":["openapi","wasm","webassembly","extism","cli"],"repository":{"type":"git","url":"git+https://github.com/micro-wasm/openapi2wasm.git"},"author":{"name":"microchipgnu"},"bugs":{"url":"https://github.com/micro-wasm/openapi2wasm/issues"},"license":"MIT","readme":"# OpenAPI to WebAssembly CLI\n\nA command-line tool built with Bun and Extism to convert OpenAPI specifications into WebAssembly plugins.\n\n## Features\n\n- Convert OpenAPI specification files (YAML or JSON) to WASM plugins\n- Automatically generate TypeScript handlers for each API endpoint\n- Create a compatible WebAssembly module and manifest file\n- Support for path parameters, query parameters, and request bodies\n\n## Prerequisites\n\n- [Bun](https://bun.sh/) (v1.0.0 or higher)\n- [Extism JS PDK](https://github.com/extism/js-pdk)\n\n## Installation\n\n### NPM Installation\n```bash\n# Install globally\nnpm install -g openapi2wasm\n\n# Or install locally in your project\nnpm install --save-dev openapi2wasm\n```\n\n### Manual Installation\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/openapi-2-wasm-cli.git\ncd openapi-2-wasm-cli\n\n# Install dependencies\nbun install\n```\n\n## Usage\n\n```bash\n# If installed via npm (globally)\nopenapi2wasm --schema path/to/your/openapi.yaml\n\n# If installed manually or locally\n./index.ts --schema path/to/your/openapi.yaml\n\n# Specify output directory\nopenapi2wasm --schema path/to/your/openapi.yaml --output ./dist\n\n# Specify a custom name for the plugin\nopenapi2wasm --schema path/to/your/openapi.yaml --name my-custom-plugin\n```\n\n### Options\n\n- `--schema, -s`: Path to the OpenAPI schema file (YAML or JSON) (required)\n- `--output, -o`: Output directory for the generated files (default: current directory)\n- `--name, -n`: Custom name for the plugin (default: derived from the schema's title)\n\n## Output Files\n\nThe tool generates:\n\n- `[plugin-name].wasm`: The WebAssembly plugin file\n- `manifest.json`: The plugin manifest file for Extism\n\n## How it Works\n\n1. The tool reads and parses the OpenAPI specification\n2. Generates TypeScript code for each API endpoint\n3. Creates PDK integration files\n4. Compiles the TypeScript code to JavaScript\n5. Uses Extism to build the final WASM plugin\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-ee410c8edc5f79cb34883312ab89cbd7"}