{"id":28439013,"url":"https://github.com/benoitpetit/gowm","last_synced_at":"2026-04-11T12:03:56.336Z","repository":{"id":296056686,"uuid":"992083438","full_name":"benoitpetit/gowm","owner":"benoitpetit","description":"GoWM simplifies the integration of Go WebAssembly modules into your JavaScript projects.","archived":false,"fork":false,"pushed_at":"2025-06-17T01:27:23.000Z","size":2501,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-17T01:37:39.276Z","etag":null,"topics":["golang","npm","react","vue","wasm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/gowm","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/benoitpetit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T15:35:54.000Z","updated_at":"2025-06-17T01:28:29.000Z","dependencies_parsed_at":"2025-05-28T20:11:38.579Z","dependency_job_id":"a478e7e6-d226-40a7-b8ce-f250e124926c","html_url":"https://github.com/benoitpetit/gowm","commit_stats":null,"previous_names":["benoitpetit/gowm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/benoitpetit/gowm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitpetit%2Fgowm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitpetit%2Fgowm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitpetit%2Fgowm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitpetit%2Fgowm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benoitpetit","download_url":"https://codeload.github.com/benoitpetit/gowm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benoitpetit%2Fgowm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260722008,"owners_count":23052268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","npm","react","vue","wasm"],"created_at":"2025-06-06T02:06:24.444Z","updated_at":"2026-04-11T12:03:56.329Z","avatar_url":"https://github.com/benoitpetit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoWM - Go Wasm Manager\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./logo.png\" alt=\"GoWM Logo\" width=\"200\" /\u003e\n\n  \u003cp\u003e\u003cstrong\u003eGoWM\u003c/strong\u003e simplifies the integration of Go Wasm modules into your JavaScript projects\u003c/br\u003e with seamless GitHub repository support, React hooks, and Vue composables.\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/gowm\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/gowm.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/benoitpetit/gowm/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/npm/l/gowm.svg\" alt=\"license\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://www.npmjs.com/package/gowm\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/gowm.svg\" alt=\"downloads\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n## ✨ Features\n\n- 🚀 **Loader System** - Intelligent loader for all source types (files, URLs, GitHub)\n- 🔧 **Cross-Platform** - Full support for Node.js and browser environments\n- 🎯 **Auto-Detection** - Automatically detects source type and optimal loading strategy\n- 📦 **GitHub Direct Loading** - Load WASM modules directly from GitHub repositories\n- 🏷️ **Version Control** - Support for branches, tags, and specific commits\n- 🛡️ **Enhanced Error Handling** - Robust error handling with fallback strategies\n- 🧹 **Smart Memory Management** - Safe memory allocation and resource cleanup\n- 📊 **Comprehensive Statistics** - Built-in monitoring, testing, and performance metrics\n- 🔄 **Flexible API** - Both synchronous and asynchronous function calls\n- 📝 **TypeScript Support** - Full TypeScript definitions included\n- ⚛️ **React Hooks** - `useWasm()` and `useWasmFromGitHub()` hooks\n- 💚 **Vue Composables** - `useWasm()` and `useWasmFromGitHub()` composables\n- 🔧 **CLI** - `npx gowm list|info|types|verify|install`\n- 📡 **Event System** - `on()` / `off()` / `once()` / `on('module:loaded')`, `on('module:error')`, `on('memory:warning')` with chaining for module lifecycle events\n- 🏗️ **Type Generator** - Generate TypeScript interfaces from `module.json`\n- ⚛️ **React Hooks** - `import { useWasm } from 'gowm/react'` with auto-cleanup and reload\n- 💚 **Vue 3 Composables** - `import { useWasm } from 'gowm/vue'` with reactive refs and watch\n- 🔧 **CLI** - `npx gowm list|info|types|verify|install` for module discovery and management\n- 🏗️ **Type Generator** - `generateTypes()` creates TypeScript interfaces from `module.json`\n- 📦 **ESM Exports Map** - Sub-path exports `gowm/react`, `gowm/vue`, `gowm/tools/type-generator`\n- 📋 **TypeScript Definitions** - Dedicated `types/react.d.ts` and `types/vue.d.ts`\n- 📋 **Module Metadata** - Automatic `module.json` fetching from GitHub repositories\n- 🔒 **SHA256 Integrity** - WASM file integrity verification via `.wasm.integrity` files (SRI format)\n- 🎯 **readySignal Auto-Discovery** - Uses `gowmConfig.readySignal` from metadata instead of generic polling\n- ✅ **Function Call Validation** - Parameter count validation, type warnings in debug mode\n- 📖 **`describe()` Documentation** - Inline documentation for functions (`bridge.describe('add')`)\n- 📊 **`getDetailedFunctions()`** - Rich function listing with parameters, types, examples\n- 🗂️ **`getFunctionCategories()`** - Organized function categories from metadata\n- 💾 **Multi-Level Cache** - Memory (L1) + disk/IndexedDB (L2) caching with configurable TTL\n- 🔁 **Retry with Backoff** - Automatic retry with exponential backoff on network failures\n- ⚡ **Streaming Instantiation** - `WebAssembly.instantiateStreaming()` for HTTP loads (compile during download)\n- 🎯 **Promise-Based Readiness** - Callback-first signals with adaptive polling fallback\n- 📦 **Compressed WASM** - Auto-detect and decompress `.wasm.gz` and `.wasm.br` files\n- 🔒 **Module Namespace Isolation** - Each module gets its own namespace via `globalThis.__gowm_modules_`\n- 🌿 **Auto Branch Detection** - GitHub default branch auto-detected via API\n- 🔍 **Improved Source Detection** - Strict local path and GitHub URL detection\n- 📝 **Configurable Logging** - Log levels with custom logger support\n- 🛡️ **Safe Memory Allocation** - Removed unsafe offset-based fallback\n- 🧪 **274 Unit Tests** - Extended coverage for all features\n\n## 📥 Installation\n\n```bash\nnpm install gowm\n# or\nyarn add gowm\n# or\npnpm add gowm\n```\n\n## 🚀 Quick Start\n\n### Node.js Example\n\n```javascript\nconst { GoWM } = require(\"gowm\");\n\nasync function example() {\n  try {\n    // Create a GoWM instance with configurable logging\n    const gowm = new GoWM({ logLevel: \"info\" });\n\n    // Load from GitHub repository (branch auto-detected)\n    // module.json metadata fetched, SHA256 integrity verified\n    const math = await gowm.loadFromGitHub(\n      \"benoitpetit/wasm-modules-repository\",\n      {\n        name: \"math\",\n        path: \"math-wasm\",\n        retries: 3, // retry on network failure\n        cache: { ttl: 3600000 }, // cache for 1 hour\n        // metadata: true,      // auto-fetch module.json (default)\n        // integrity: true,     // verify SHA256 hash (default)\n        // validateCalls: true, // validate parameters (default)\n      },\n    );\n\n    // Call functions (parameters validated against metadata)\n    const result = math.call(\"add\", 5, 3);\n    console.log(\"5 + 3 =\", result); // 8\n\n    // Describe a function from module.json metadata\n    const desc = gowm.describeFunction(\"math\", \"add\");\n    console.log(desc);\n    // { name: 'add', description: '...', parameters: [...], returnType: '...' }\n\n    // Get detailed function list with metadata\n    const functions = math.getDetailedFunctions();\n    console.log(\"Functions:\", functions.length);\n\n    // Get function categories\n    const categories = math.getFunctionCategories();\n    console.log(\"Categories:\", Object.keys(categories));\n\n    // Module metadata\n    const metadata = gowm.getModuleMetadata(\"math\");\n    console.log(`${metadata.name} v${metadata.version}`);\n\n    // Load from HTTP URL (uses streaming instantiation when possible)\n    const remoteWasm = await gowm.loadFromUrl(\n      \"https://example.com/module.wasm\",\n    );\n\n    // Load from local file\n    const localWasm = await gowm.load(\"./math.wasm\", { name: \"local-math\" });\n\n    // Disable cache for a specific load\n    const freshLoad = await gowm.load(\"./module.wasm\", { cache: false });\n\n    // Async calls\n    const asyncResult = await math.callAsync(\"multiply\", 4, 7);\n    console.log(\"4 * 7 =\", asyncResult); // 28\n\n    // Check available functions\n    if (math.hasFunction(\"divide\")) {\n      console.log(\"divide function is available\");\n    }\n\n    // Get comprehensive statistics\n    const stats = math.getStats();\n    console.log(\"Available functions:\", stats.functions);\n    console.log(\"Memory usage:\", stats.memoryUsage);\n\n    // Clear the cache\n    await gowm.clearCache();\n  } catch (error) {\n    console.error(\"Error:\", error);\n  }\n}\n\nexample();\n```\n\n## 🔄 Loader System\n\nGoWM features a loader system that handles all source types with a single API:\n\n### Auto-Detection\n\n```javascript\nconst { load } = require(\"gowm\");\n\n// Automatically detects source type\nawait load(\"owner/repo\"); // → GitHub repository\nawait load(\"https://example.com/module.wasm\"); // → HTTP URL\nawait load(\"./local/module.wasm\"); // → Local file\nawait load(\"/absolute/path/module.wasm\"); // → Absolute path\n```\n\n### Specific Loading Methods\n\n```javascript\nconst { loadFromFile, loadFromUrl, loadFromGitHub } = require(\"gowm\");\n\n// Explicit methods for specific sources\nawait loadFromFile(\"./module.wasm\"); // Node.js only\nawait loadFromUrl(\"https://example.com/mod.wasm\"); // HTTP/HTTPS\nawait loadFromGitHub(\"owner/repo\", options); // GitHub repository\n```\n\n## 🐙 GitHub Repository Loading\n\nGoWM excels at loading WASM modules directly from GitHub repositories with intelligent file discovery and automatic default branch detection:\n\n```javascript\nconst { GoWM } = require(\"gowm\");\nconst gowm = new GoWM();\n\nasync function examples() {\n  // Basic loading — branch auto-detected via GitHub API\n  const math = await gowm.loadFromGitHub(\n    \"benoitpetit/wasm-modules-repository\",\n    {\n      path: \"math-wasm\",\n    },\n  );\n\n  // Advanced loading with specific options\n  const crypto = await gowm.loadFromGitHub(\n    \"benoitpetit/wasm-modules-repository\",\n    {\n      path: \"crypto-wasm\",\n      filename: \"main.wasm\",\n      name: \"crypto-processor\",\n      timeout: 30000, // Custom timeout\n    },\n  );\n\n  // Load from full GitHub URL\n  const image = await gowm.loadFromGitHub(\n    \"https://github.com/benoitpetit/wasm-modules-repository\",\n    {\n      path: \"image-wasm\",\n      filename: \"main.wasm\",\n    },\n  );\n}\n```\n\n### Automatic File Discovery\n\nGoWM automatically searches for WASM files in these locations:\n\n- **Root directory**: `main.wasm`, `index.wasm`, `{repo-name}.wasm`\n- **Common folders**: `wasm/`, `dist/`, `build/`\n- **GitHub releases**: Searches release assets for WASM files\n- **Custom paths**: Respects your specified path and filename\n\n## 📚 API Reference\n\n### Core Functions\n\n#### `load(source, options)`\n\nUniversal loading function that auto-detects source type.\n\n**Parameters:**\n\n- `source` (string): Can be file path, HTTP URL, or GitHub repo\n- `options` (object, optional):\n  - `name` (string): Module identifier\n  - `timeout` (number): Initialization timeout (default: 15000ms)\n  - `preInit` (boolean): Pre-initialize module (default: true)\n  - `goRuntimePath` (string): Custom path to wasm_exec.js\n\n**Returns:** Promise\u003cWasmBridge\u003e\n\n#### `loadFromGitHub(githubRepo, options)`\n\nLoads a WASM module from a GitHub repository with automatic file resolution.\n\n**Parameters:**\n\n- `githubRepo` (string): GitHub repository (\"owner/repo\" or full GitHub URL)\n- `options` (object, optional):\n  - `name` (string): Module identifier (default: repository name)\n  - `branch` (string): Git branch (default: auto-detected via GitHub API)\n  - `tag` (string): Git tag (takes precedence over branch)\n  - `path` (string): Path within repository (default: '')\n  - `filename` (string): Specific filename (default: auto-detect)\n  - `timeout` (number): Initialization timeout (default: 15000ms)\n  - `goRuntimePath` (string): Custom path to wasm_exec.js\n  - `preInit` (boolean): Pre-initialize the module (default: true)\n  - `metadata` (boolean): Fetch module.json metadata (default: true)\n  - `integrity` (boolean): Verify SHA256 integrity (default: true)\n  - `validateCalls` (boolean): Validate function parameters (default: true)\n\n**Returns:** Promise\u003cWasmBridge\u003e\n\n#### `loadFromUrl(url, options)`\n\nLoads a WASM module from HTTP/HTTPS URL.\n\n**Parameters:**\n\n- `url` (string): HTTP/HTTPS URL to WASM file\n- `options` (object, optional): Same as `load()` options\n\n**Returns:** Promise\u003cWasmBridge\u003e\n\n#### `loadFromFile(filePath, options)`\n\nLoads a WASM module from local file (Node.js only).\n\n**Parameters:**\n\n- `filePath` (string): Path to the .wasm file\n- `options` (object, optional): Same as `load()` options\n\n**Returns:** Promise\u003cWasmBridge\u003e\n\n#### `get(name)`\n\nRetrieves an already loaded module by name.\n\n**Parameters:**\n\n- `name` (string, optional): Module name (default: 'default')\n\n**Returns:** UnifiedWasmBridge | null\n\n### Enhanced Bridge Methods\n\nThe bridge provides comprehensive functionality:\n\n#### `call(funcName, ...args)`\n\nCalls a WASM function synchronously. Validates parameter count and types (debug mode) against module.json metadata.\n\n#### `callAsync(funcName, ...args)`\n\nCalls a WASM function asynchronously.\n\n#### `describe(funcName)`\n\nReturns inline documentation for a function from module.json metadata.\n\n**Returns:** `{ name, description, category, parameters, returnType, example, errorPattern }` or `null`\n\n#### `getDetailedFunctions()`\n\nReturns all functions with their full metadata (parameters, types, descriptions).\n\n**Returns:** `Array\u003c{ name, description, category, parameters, returnType, example }\u003e`\n\n#### `getMetadata()`\n\nReturns the raw module.json metadata object.\n\n#### `getFunctionCategories()`\n\nReturns function categories from metadata.\n\n**Returns:** `{ [category: string]: string[] }` or `null`\n\n#### `createBuffer(data)`\n\nCreates a buffer for data transfer with enhanced type support.\n\n**Supported Types:**\n\n- `Float64Array`, `Float32Array`\n- `Uint8Array`, `Uint16Array`, `Uint32Array`\n- `Int8Array`, `Int16Array`, `Int32Array`\n- `Array`, `string`\n\n#### `test()`\n\nRuns comprehensive tests on the module.\n\n**Returns:** Object with test results:\n\n```javascript\n{\n  functionCalls: boolean,\n  memoryAllocation: boolean,\n  callbacks: boolean,\n  asyncCalls: boolean,\n  errors: string[]\n}\n```\n\n#### `getStats()`\n\nGets comprehensive module statistics.\n\n**Returns:** Object with detailed statistics:\n\n```javascript\n{\n  name: string,\n  ready: boolean,\n  environment: 'Node.js' | 'Browser',\n  functions: string[],\n  callbacks: string[],\n  allocatedBuffers: number,\n  memoryUsage: {\n    total: number,\n    wasm: number,\n    go: number,\n    buffers: number,\n    buffersCount: number\n  },\n  supportedDataTypes: string[],\n  loadedAt: string\n}\n```\n\n### Utility Functions\n\n- `listModules()`: List all loaded modules\n- `getStats()`: Get statistics for all modules\n- `unload(name)`: Unload a specific module\n- `unloadAll()`: Unload all modules\n- `isLoaded(name)`: Check if a module is loaded\n- `getTotalMemoryUsage()`: Get total memory usage\n- `testAll()`: Test all loaded modules\n- `getHelp()`: Get comprehensive help information\n- `getVersion()`: Get GoWM version string\n- `clearCache()`: Clear all cached WASM bytes\n- `getModuleMetadata(name)`: Get module.json metadata\n- `describeFunction(moduleName, funcName)`: Describe a function from metadata\n- `on(event, callback)`: Register event listener\n- `off(event, callback)`: Remove event listener\n- `once(event, callback)`: One-time event listener\n- `generateTypes(metadata, options)`: Generate TypeScript types\n- `generateTypesFromGitHub(repo, options)`: Generate types from GitHub\n\n## 🌐 Browser Usage\n\nFor browser environments, GoWM automatically optimizes for the browser:\n\n```html\n\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import { loadFromGitHub } from \"./node_modules/gowm/src/browser.js\";\n\n      async function init() {\n        const wasm = await loadFromGitHub(\n          \"benoitpetit/wasm-modules-repository\",\n          {\n            path: \"math-wasm\",\n          },\n        );\n        const result = wasm.call(\"add\", 21, 21);\n        console.log(\"21 + 21 =\", result); // 42\n      }\n\n      init();\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003ch1\u003eGoWM Browser Example\u003c/h1\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### Global Usage\n\n```html\n\u003cscript src=\"path/to/gowm/src/browser.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  GoWM.loadFromUrl(\"https://example.com/module.wasm\");\n\u003c/script\u003e\n```\n\n## 📡 Event System\n\nMonitor module lifecycle with event listeners:\n\n```javascript\nconst gowm = new GoWM({ memoryWarningThreshold: 50 * 1024 * 1024 });\n\ngowm\n  .on(\"module:loading\", ({ name, source }) =\u003e console.log(`Loading ${name}...`))\n  .on(\"module:loaded\", ({ name, loadTime }) =\u003e\n    console.log(`Loaded in ${loadTime}ms`),\n  )\n  .on(\"module:error\", ({ name, error }) =\u003e\n    console.error(`Failed: ${error.message}`),\n  )\n  .on(\"module:unloaded\", ({ name }) =\u003e console.log(`Unloaded ${name}`))\n  .on(\"memory:warning\", ({ totalMemory, threshold }) =\u003e\n    console.warn(\"Memory warning!\"),\n  );\n\n// One-time listener\ngowm.once(\"module:loaded\", ({ name }) =\u003e\n  console.log(`First module loaded: ${name}`),\n);\n\n// Remove listener\nconst handler = (data) =\u003e console.log(data);\ngowm.on(\"module:loaded\", handler);\ngowm.off(\"module:loaded\", handler);\n```\n\n## ⚛️ React Hooks\n\n```bash\nnpm install gowm react\n```\n\n```tsx\nimport { useWasm, useWasmFromGitHub } from \"gowm/react\";\n\nfunction Calculator() {\n  const { bridge, loading, error, reload } = useWasmFromGitHub(\n    \"benoitpetit/wasm-modules-repository\",\n    { path: \"math-wasm\" },\n  );\n\n  if (loading) return \u003cp\u003eLoading...\u003c/p\u003e;\n  if (error) return \u003cp\u003eError: {error.message}\u003c/p\u003e;\n\n  return (\n    \u003cdiv\u003e\n      \u003cp\u003e5 + 3 = {bridge.call(\"add\", 5, 3)}\u003c/p\u003e\n      \u003cbutton onClick={reload}\u003eReload\u003c/button\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## 💚 Vue 3 Composables\n\n```bash\nnpm install gowm vue\n```\n\n```vue\n\u003cscript setup\u003e\nimport { useWasmFromGitHub } from \"gowm/vue\";\n\nconst { bridge, loading, error, metadata, reload } = useWasmFromGitHub(\n  \"benoitpetit/wasm-modules-repository\",\n  { path: \"math-wasm\" },\n);\n\u003c/script\u003e\n\n\u003ctemplate\u003e\n  \u003cp v-if=\"loading\"\u003eLoading...\u003c/p\u003e\n  \u003cp v-else-if=\"error\"\u003eError: {{ error.message }}\u003c/p\u003e\n  \u003cdiv v-else\u003e\n    \u003cp\u003e{{ metadata?.name }} v{{ metadata?.version }}\u003c/p\u003e\n    \u003cp\u003e5 + 3 = {{ bridge.call(\"add\", 5, 3) }}\u003c/p\u003e\n    \u003cbutton @click=\"reload\"\u003eReload\u003c/button\u003e\n  \u003c/div\u003e\n\u003c/template\u003e\n```\n\n## 🔧 CLI\n\n```bash\n# List available modules in a repository\nnpx gowm list benoitpetit/wasm-modules-repository\n\n# Get module info from module.json\nnpx gowm info benoitpetit/wasm-modules-repository math-wasm\n\n# Generate TypeScript types from module.json\nnpx gowm types benoitpetit/wasm-modules-repository math-wasm --out math-wasm.d.ts\n\n# Verify WASM file integrity\nnpx gowm verify ./main.wasm --integrity sha256-xxxxxxxxx\n\n# Download a module (wasm + module.json + integrity)\nnpx gowm install benoitpetit/wasm-modules-repository math-wasm --dir ./wasm\n```\n\n## 🏗️ Type Generator\n\nGenerate TypeScript interfaces from `module.json`:\n\n```javascript\nconst { generateTypes, generateTypesFromGitHub } = require(\"gowm\");\n\n// From a metadata object\nconst ts = generateTypes(metadata, { includeJSDoc: true });\n\n// From GitHub\nconst ts = await generateTypesFromGitHub(\n  \"benoitpetit/wasm-modules-repository/math-wasm\",\n  { branch: \"master\" },\n);\n```\n\nGenerated output:\n\n```typescript\nimport { WasmBridge } from \"gowm\";\n\n/** math-wasm v0.2.0 - Mathematical functions */\nexport interface MathWasmBridge extends WasmBridge {\n  /** Add two numbers */\n  call(func: \"add\", a: number, b: number): number;\n  /** Calculate factorial */\n  call(func: \"factorial\", n: number): number;\n  // ...\n}\n```\n\n## 🏗️ Architecture\n\nGoWM features a clean architecture:\n\n```\nsrc/\n├── core/gowm.js              # Main GoWM class (events, logging)\n├── loaders/unified-loader.js  # Universal loading system with metadata \u0026 integrity\n├── bridges/unified-bridge.js  # Namespace-aware bridge with validation \u0026 describe()\n├── react/index.js             # React hooks (useWasm, useWasmFromGitHub)\n├── vue/index.js               # Vue 3 composables (useWasm, useWasmFromGitHub)\n├── cli/gowm-cli.js            # CLI (list, info, types, verify, install)\n├── tools/type-generator.js    # TypeScript type generation from module.json\n├── index.js                   # Main entry point\n└── browser.js                 # Browser-optimized entry\ntypes/\n├── index.d.ts                 # Core TypeScript definitions\n├── react.d.ts                 # React hooks types\n└── vue.d.ts                   # Vue composables types\n```\n\n## 📊 Examples\n\nCheck out the `/examples` directory for comprehensive examples:\n\n- **Node.js examples**: Basic, crypto, text, and JSON/XML usage patterns\n- **Browser examples**: Vanilla JavaScript implementations\n\n### Running Examples\n\n```bash\n# Run basic Node.js example\nnpm run test:basic\n\n# Run crypto example\nnpm run test:crypto\n\n# Serve browser examples\nnpm run demo:serve\n```\n\n## 🔧 Development\n\n### Running Tests\n\n```bash\n# Run all unit tests\nnpm test\n\n# Run tests with coverage report\nnpm run test:coverage\n\n# Run all tests (unit + integration + examples)\nnpm run test:all\n```\n\n### Testing Your Modules\n\n```javascript\nconst { GoWM } = require(\"gowm\");\nconst gowm = new GoWM({ logLevel: \"debug\" });\n\n// Load and test a module\nconst module = await gowm.load(\"your-module.wasm\");\nconst testResults = module.test();\nconsole.log(\"Test results:\", testResults);\n\n// Get comprehensive statistics\nconst stats = gowm.getStats();\nconsole.log(\"System stats:\", stats);\n```\n\n### Custom Loading\n\n```javascript\nconst { WasmLoader, WasmBridge } = require(\"gowm\");\n\n// Use components directly for advanced scenarios\nconst loader = new WasmLoader();\nconst module = await loader.loadModule(\"source\");\nconst bridge = new WasmBridge(module, { moduleId: \"my-module\" });\n```\n\n## 📄 License\n\nMIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Links\n\n- [NPM Package](https://www.npmjs.com/package/gowm)\n- [GitHub Repository](https://github.com/benoitpetit/gowm)\n- [Documentation](https://github.com/benoitpetit/gowm/blob/main/README.md)\n- [Examples](https://github.com/benoitpetit/gowm/tree/main/examples)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003cp\u003eMade with ❤️ by \u003ca href=\"https://github.com/benoitpetit\"\u003e@devbyben\u003c/a\u003e\u003c/p\u003e\n  \u003cp\u003e⭐ Star us on GitHub if this project helped you!\u003c/p\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitpetit%2Fgowm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenoitpetit%2Fgowm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenoitpetit%2Fgowm/lists"}