{"_id":"esbuild-plugin-wasm","_rev":"3-c2007d9592e65bbe967b924d99b9e2cb","name":"esbuild-plugin-wasm","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"esbuild-plugin-wasm","version":"1.0.0","description":"A WASM file loader for esbuild.","keywords":["wasm","webassembly","esbuild","plugin","esbuild-plugin"],"homepage":"https://github.com/Tschrock/esbuild-plugin-wasm#readme","bugs":{"url":"https://github.com/Tschrock/esbuild-plugin-wasm/issues"},"license":"MIT","author":{"name":"Tyler Schrock","email":"tschrock123@gmail.com"},"funding":{"type":"individual","url":"https://ko-fi.com/tschrock"},"main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/Tschrock/esbuild-plugin-wasm.git"},"scripts":{"test":"gulp test","clean":"gulp clean","bundle":"gulp bundle","types":"gulp types","build":"gulp build","lint":"gulp lint","prepare":"gulp prepare","prepublishOnly":"gulp prepublishOnly"},"devDependencies":{"@types/chai":"^4.2.18","@types/eslint":"^7.2.13","@types/gulp":"^4.0.8","@types/mocha":"^8.2.2","@types/node":"^15.12.2","@typescript-eslint/eslint-plugin":"^4.27.0","@typescript-eslint/parser":"^4.27.0","chai":"^4.3.4","del":"^6.0.0","esbuild":"^0.12.8","eslint":"^7.28.0","gulp":"^4.0.2","gulp-typescript":"^6.0.0-alpha.1","mocha":"^9.0.0","ts-node":"^10.0.0","typescript":"^4.3.3"},"engines":{"node":">=0.10.0"},"gitHead":"dbcb9530d2ff26c5161b32f785ffa51d75fe5a0c","_id":"esbuild-plugin-wasm@1.0.0","_nodeVersion":"14.17.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-iXIf3hwfqorExG66/eNr3U8JakIZuge70nMNQtinvxbzdljQ/RjvwaBiGPqF/DvuIumUApbe3zj2kqHLVyc7uQ==","shasum":"4ca95ac4ae553331d2b0099223f8713a49b6cff2","tarball":"https://registry.npmjs.org/esbuild-plugin-wasm/-/esbuild-plugin-wasm-1.0.0.tgz","fileCount":8,"unpackedSize":203412,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgysQTCRA9TVsSAnZWagAArEEP/jlHlsBDommdZ/UPv5up\njZokx3LGSQR6jIqXyhtoQyIvQ28FaDUKmTdgrhSOYfXfFFKtdr/auaHbtlHo\nsiNFP4wcDW7E5uSkz16rKu/QoRHrLEyKnDzT9CszaqUYPda7DuJVtccW8jqx\nhAYvZ2QeQcdIgYN/1h7499hVjPBd9TL8/SbRNeA8LyYT0Ux96T51LJGSFrW1\nO8i1WYR7uwTTsHBAcx83+hN/RVsI13z1VkNSXRMDlzZ33c9IcBT17sMw7Ste\nXU8sVUKaS2XFKQjIBJRvbuuPb3aXeIyXDMKWw3RQYbda2hYioZ0w7BUM7e4C\nF+Wc4rT98EmZE6bSA7iafW4B//dbyghlgfA8qhEZCB4zPTyXtFzvOifgUGKq\nE0VfZdyOnBebqenxmqc1RhMpJXYEhGzLBTQXOgkfwJLsjXkMMTirEtYCgVyu\n0frcaKHSi9A7gYzn17Bj8mzb+JKaCleglJOYOKHIMJSz9xOKCQPr6h2gBF7H\ngdWkTrXUJfCaPZdnfPGVG75qR05HeZ4LKKhF+eoHbrH5bEaqWwV4Rwua3+io\nlO2txcz4M+2b4jU47YGEjFqRhYe1nVLnlxTiGApEiBiQ9zHERPJKQjwDIXBk\naeEXcFOeafJxVDapVBdhEcy5UUjLAsDyMXbNI9IXGi7yp65YiYqLIhhby2FS\nDtvi\r\n=8Jco\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVMMaAJLi3qmDvj/MwtKXZoyfpBBYybG70us85O/nQmgIgHw9gK1bxGbA0MdWiTvBPvSjHISeeU/aO+laAgqis4z4="}]},"_npmUser":{"name":"tschrock123","email":"tschrock123@gmail.com"},"directories":{},"maintainers":[{"name":"tschrock123","email":"tschrock123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esbuild-plugin-wasm_1.0.0_1623901202673_0.5377942345623477"},"_hasShrinkwrap":false},"1.1.0":{"name":"esbuild-plugin-wasm","version":"1.1.0","description":"A WASM file loader for esbuild.","keywords":["wasm","webassembly","esbuild","plugin","esbuild-plugin"],"homepage":"https://github.com/Tschrock/esbuild-plugin-wasm#readme","bugs":{"url":"https://github.com/Tschrock/esbuild-plugin-wasm/issues"},"license":"MIT","author":{"name":"Tyler Schrock","email":"tschrock123@gmail.com"},"funding":{"type":"individual","url":"https://ko-fi.com/tschrock"},"main":"dist/index.js","repository":{"type":"git","url":"git+https://github.com/Tschrock/esbuild-plugin-wasm.git"},"scripts":{"test":"gulp test","clean":"gulp clean","bundle":"gulp bundle","types":"gulp types","build":"gulp build","lint":"gulp lint","prepare":"gulp prepare","prepublishOnly":"gulp prepublishOnly"},"devDependencies":{"@types/chai":"^4.2.18","@types/chai-as-promised":"^7.1.5","@types/eslint":"^8.37.0","@types/gulp":"^4.0.8","@types/mocha":"^10.0.1","@types/node":"^18.16.3","@typescript-eslint/eslint-plugin":"^5.59.2","@typescript-eslint/parser":"^5.59.2","chai":"^4.3.4","chai-as-promised":"^7.1.1","del":"^6.0.0","esbuild":"^0.17.18","eslint":"^8.39.0","gulp":"^4.0.2","gulp-typescript":"^6.0.0-alpha.1","mocha":"^10.2.0","ts-node":"^10.0.0","typescript":"^5.0.4"},"engines":{"node":">=0.10.0"},"types":"./dist/index.d.ts","gitHead":"6acc2d6dcd3592c30b7a20aa0df746370413b0fa","_id":"esbuild-plugin-wasm@1.1.0","_nodeVersion":"19.1.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-0bQ6+1tUbySSnxzn5jnXHMDvYnT0cN/Wd4Syk8g/sqAIJUg7buTIi22svS3Qz6ssx895NT+TgLPb33xi1OkZig==","shasum":"062c0e62c266e94165c66ebcbb5852a1cdbfd7cd","tarball":"https://registry.npmjs.org/esbuild-plugin-wasm/-/esbuild-plugin-wasm-1.1.0.tgz","fileCount":7,"unpackedSize":10831,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwPeUHZkVe4jpEfU/2PbqYD1sX5kC1QVXQuFzXR1LXMAIgQds3HwCYPC/yMQ1K141prOjSLUyO9mixgVfM+EPdFJ8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUhMrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGHA//YtwKdzcdoBBfpxutXMb6eZU8TSB/74sQwV0E8JFV8IHoV9wY\r\nAnMe1GPuvo3X8ikD9iFD9Az26mv+RgbeAqlzKiL739+RLJtRh5R7TStl6E9g\r\nuVghOP+fDVW9PZpw3kJgLRRCGAhP3Wf0h3GbPJ2WyRZ0XD1lZfPLiq1fONFw\r\n7VnojAi+GUoVLkLoSolWVvp86o5q6R0QINUgV2WBn/UCwG1ZN1FAAuWycKX/\r\n2NN6afWAyXsfb8juUeH2xd1Z0PkyObXd7G4Y/3ikMdFvo24NDX0EROIM1My6\r\naXor5dgySBoql6+R0g9hRbVjzv0FdHEMxeASF5gurm/dgrd+itYQc9inNU/V\r\nLBL8CAJRHtUiJLXGNd1CHFsQBqpH2IdOeHmH18o7PfpMuC4IztCntcG9m2SL\r\nKpQrQYBRH4IZtFx6ZTtc1Rr1gpj91WmehkjqfX/XyP8QVtYH8EdFC3caiH5F\r\nYsIfDLQakIaMXw256C+q1wto3GERhxSzhEC4ikP5O88QQm5EYxHQ0HI0EzoR\r\nSjii6h8fOe86lRp/ETNcmTywVW4n1Lea5iEGiqSggI/DKpQF85UIB2fFkEAk\r\n+f0K9h27EtBO+2rYM24MKVV4yimzaPiiIQcZQURpoCM3hKHsgSsJ4/BMYga7\r\n4eOCh0UeklyZZfQRZmtyGYt+bvMqRPJftkw=\r\n=DXvA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"tschrock","email":"tschrock123@gmail.com"},"directories":{},"maintainers":[{"name":"tschrock123","email":"tschrock123+oldnpm@gmail.com"},{"name":"tschrock","email":"tschrock123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/esbuild-plugin-wasm_1.1.0_1683100459099_0.11641073687123171"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-17T03:40:02.672Z","1.0.0":"2021-06-17T03:40:02.851Z","modified":"2023-05-03T07:54:19.415Z","1.1.0":"2023-05-03T07:54:19.289Z"},"maintainers":[{"name":"tschrock123","email":"tschrock123+oldnpm@gmail.com"},{"name":"tschrock","email":"tschrock123@gmail.com"}],"description":"A WASM file loader for esbuild.","homepage":"https://github.com/Tschrock/esbuild-plugin-wasm#readme","keywords":["wasm","webassembly","esbuild","plugin","esbuild-plugin"],"repository":{"type":"git","url":"git+https://github.com/Tschrock/esbuild-plugin-wasm.git"},"author":{"name":"Tyler Schrock","email":"tschrock123@gmail.com"},"bugs":{"url":"https://github.com/Tschrock/esbuild-plugin-wasm/issues"},"license":"MIT","readme":"esbuild-plugin-wasm\n===================\n\nAn asynchronous `.wasm` file loader for [esbuild](https://esbuild.github.io/). This allows you to directly import `.wasm` files as if they were a javascript module, similar to how it works in Webpack.\n\nThis plugin follows the [WebAssembly/ES Module Integration](https://github.com/WebAssembly/esm-integration) proposal for loading WebAssembly from a JavaScript import statement.\n\n## Requirements\n- esbuild >= 0.11.0\n- node >= 10.0.0\n\n### ⚠️ Important Note ⚠️\n\nThis loader makes use of top-level await, which only has partial support in esbuild. For now, it is only supported with the `esm` output format, not the `iife` or `cjs` formats. See https://github.com/evanw/esbuild/issues/253\n\n## Installation\n\n```\nnpm install --save-dev esbuild-plugin-wasm\n```\n\nor\n\n```\nyarn add --dev esbuild-plugin-wasm\n```\n\n## Usage\n1. Add it to your esbuild plugins list\n\n    <details>\n    <summary>CommonJS</summary>\n\n    ```js\n    // build.js\n    const esbuild = require('esbuild')\n    const { wasmLoader } = require('esbuild-plugin-wasm')\n\n    esbuild.build({\n    ...\n    plugins: [\n        wasmLoader()\n    ]\n    ...\n    });\n    ```\n\n    </details>\n\n    <details>\n    <summary>ESM</summary>\n\n    ```js\n    // build.js\n    import esbuild from 'esbuild'\n    import { wasmLoader } from 'esbuild-plugin-wasm'\n\n    esbuild.build({\n    ...\n    plugins: [\n        wasmLoader()\n    ]\n    ...\n    });\n    ```\n\n    </details>\n\n    <details>\n    <summary>Typescript</summary>\n\n    ```ts\n    // build.ts\n    import esbuild from 'esbuild'\n    import { wasmLoader } from 'esbuild-plugin-wasm'\n\n    esbuild.build({\n    ...\n    plugins: [\n        wasmLoader()\n    ]\n    ...\n    });\n    ```\n\n    </details>\n\n\n2. Then import ad use your wasm in your project\n\n\n    <details>\n    <summary>CommonJS</summary>\n\n    ```js\n    // app.js\n    const wasm = require(\"./lib.wasm\");\n\n    console(wasm.add(1, 2));\n    ```\n\n    </details>\n\n    <details>\n    <summary>ESM</summary>\n\n    ```js\n    // app.js\n    import wasm from \"./lib.wasm\";\n\n    console(wasm.add(1, 2));\n    ```\n\n    </details>\n\n    <details>\n    <summary>Typescript</summary>\n\n    ```ts\n    // app.ts\n    import wasm from \"./lib.wasm\";\n\n    console(wasm.add(1, 2));\n    ```\n\n    </details>\n\n\n## Configuration\n\n```ts\nwasmLoader({\n    // (Default) Deferred mode copies the WASM binary to the output directory,\n    // and then `fetch()`s it at runtime. This is the default mode.\n    mode: 'deferred'\n\n    // Embedded mode embeds the WASM binary in the javascript bundle as a\n    // base64 string. Note this will greatly bloat the resulting bundle\n    // (the binary will take up about 30% more space this way)\n    mode: 'embedded'\n})\n```\n","readmeFilename":"README.md"}