{"_id":"@3kaiu/xbridge-js","_rev":"10-bfc0e0c4bc6475511641bd45eca89597","name":"@3kaiu/xbridge-js","dist-tags":{"latest":"0.1.9"},"versions":{"0.1.0":{"name":"@3kaiu/xbridge-js","version":"0.1.0","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.0","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"2e9c1d3423751a6053b09c3461de740693021870","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.0.tgz","fileCount":38,"integrity":"sha512-8R0Nban/yVbt0tNvuNf0W+ePPaGdSy9LzWB8iZwt50oeV2nemU62wPsSejJLxfUa7mCXKZhln0OvRmbccFxaKg==","signatures":[{"sig":"MEYCIQCHfQ/BB5bWURB5oYM1yrCeaN5TvcocMyWf15x62lEJoAIhAPRq9JSoW7rHEU7awDa6+46gxiPp4xZsVQILBu0QJpvU","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95805},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"bc468a9b20925bfa3ddaeae9bca72b97ed748071","scripts":{"build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.8.2","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.0_1784864979278_0.13321243353953394","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@3kaiu/xbridge-js","version":"0.1.1","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.1","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"c5895e93142e0f5b28cc0ecbdc637454b9af5d49","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.1.tgz","fileCount":38,"integrity":"sha512-dYLj1Z7H/TgSKuIrpKzJS9FOS9Iv7ZqEspwI65T60ECHBRj2lQA/J6fml/LBVP5r7X9ZFN0pepxRPR8H4V/8FQ==","signatures":[{"sig":"MEQCIBVZgOpfSdxBvXmdCq1+ewDJwzLwPohxDXkre08jnl/cAiAw1XFIjXW1SKVHkohBl1Nwc+e0TajAuUW2ZYdQ9V7ZVw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103043},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ba0b810e57b033f53a2b6f1201b7bebe516387b9","scripts":{"build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.1_1788144608077_0.9285970831777091","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@3kaiu/xbridge-js","version":"0.1.2","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.2","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"da2e0d1aa765a4d736026b2dc6373a31fcef659f","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.2.tgz","fileCount":38,"integrity":"sha512-YWR/QUZ/+LjXV59ji1af9VSvRXjJ/G1Dygbc66S9zfKd3P7hEX0MkqE5vWr3nyJDzjISKRSm6h9IHXHrbUvJqA==","signatures":[{"sig":"MEUCIQDTSkJ/cyam2HEei74AT5tsk3FJmfZnWrFfic1fqOsEWgIgVto8XunD7pVSnK+9M1LIFrMLAo2csw892UxvvcLEeNM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106083},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ae66f51bc73b5aa30d10479e7ff6602ead755b1b","scripts":{"build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.2_1788232644388_0.3952777293286971","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@3kaiu/xbridge-js","version":"0.1.3","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.3","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"fd3fdf39256c43b511b4658a53f4f280ddb7c727","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.3.tgz","fileCount":38,"integrity":"sha512-TXoX/PPlq3GdKXs43z/MZfGHCgCiLZDBZVjSdY+dTpWGHNigbrpFUlBrk+qc9hKT6oNYJXZH8pQTdi4qreYwjg==","signatures":[{"sig":"MEUCIQCsWet3KwBrvIyU039FMxULoo0frvZPsRXbpu0KnQm2qAIgKNjNLW4n5DMetwvIH+xBM+0GD3eeJ4kqmuXYFWlzFNU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":140399},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"26fe0312d9db342a61c0c5d6006e5624bb0c42ef","scripts":{"test":"node --test test/**/*.test.js","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.3_1788264803548_0.4681621360247652","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@3kaiu/xbridge-js","version":"0.1.4","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.4","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"7de83236757d45be40fcd5295940f6d1764c4e72","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.4.tgz","fileCount":38,"integrity":"sha512-Bx6jyIdAvBjBD1359fiNLFpmY6NSx2RORdsVe2HMp5+TUjD4AUDuMLpNFmRnEU6it5yJcE/rxos1nLX/vv7ZPA==","signatures":[{"sig":"MEYCIQCd0wh/XS8su2nJ6UyTwmGenSMiN3i8r6sSVgYpjt/3bQIhAJ/n3pchZeNISorBQrkfumq1Plv5Z44hD0NisQhpcY2d","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153178},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"e76d0c236e24d5d6711542b9bec39d7a26afc023","scripts":{"test":"node --test","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.4_1788340117317_0.7517325271378608","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@3kaiu/xbridge-js","version":"0.1.5","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.5","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"c27866c5bc8cc532e8f9eabe673ece56954e2d3f","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.5.tgz","fileCount":34,"integrity":"sha512-aQo+UCUK3IU4+z35x6E/Wda8weRCn3/yD33gVNkpuDc6YEAd1xXnMOTDbnibja5lIlwnYYIobqYgz6VCKdpV8w==","signatures":[{"sig":"MEQCIDLne0oBNkup7KfkAJtgork/X8PaakVEvUwnFq5b7TIlAiBFCdp46REk/GZDIkdOyjKx9ky2vmdvOv4XxSiHAzf08g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147784},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b889dc6e22ded6785f65582cbb555ba0fdb77fdb","scripts":{"test":"node --test","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.5_1788416757215_0.7016391531202222","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@3kaiu/xbridge-js","version":"0.1.6","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.6","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"2f983735c05aa5f20edbcd8ac6e0e343b0129a15","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.6.tgz","fileCount":34,"integrity":"sha512-S8QEAS6FbvujmvIUtwPRP4BXUcKdWWkRMohYPXMf6rznk2m5qgKXJT6wzqiWEOHmjqifZJ5ATlpYymf3SJcgdQ==","signatures":[{"sig":"MEUCIQC1UECodVxHwSUc1jM7Ue+rFAWJ/GcJE97hrHWWkPwNIQIge8/+B3TVRj0nJ9g3GeNOS8mtH0EvxAd+8y+re2duk7E=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151541},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"dd563b005816c1ae8c741623ed5e92ad4412b349","scripts":{"test":"node --test","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.6_1788519419923_0.8098649836381615","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@3kaiu/xbridge-js","version":"0.1.7","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.7","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"42009176c8fd7046a2316c6735d6ad5215fbdeaa","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.7.tgz","fileCount":34,"integrity":"sha512-jS00s09XoeEf6DV43JAcD2HLRVsZ3EJj+6DKGMpjpj9u6qI9HuMWIzJq20naSSz30OftgwTtBAjHCM6SwQnBaQ==","signatures":[{"sig":"MEYCIQCEccME6Ho4kPaGSn6jBjdcjzmloCOm5JRg1woZGL4rvwIhAL8pZr9ySl/d8YwPdyQQTWPHK9J5XnL/lSafdtOFENjm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":154441},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a83424a42eeddda3d89821589c7d16f0234bae3d","scripts":{"test":"node --test","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.7_1788877741691_0.45869874751453876","host":"s3://npm-registry-packages-npm-production"}},"0.1.8":{"name":"@3kaiu/xbridge-js","version":"0.1.8","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","_id":"@3kaiu/xbridge-js@0.1.8","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"dist":{"shasum":"deaa8b5d73e27f1f7611cb7b5a73d4b0f8c658ff","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.8.tgz","fileCount":34,"integrity":"sha512-OPSC7RKGPIT8+aK1ej6XkwdZ1Y6VGe5eOSUCRkwWl53nEUWyKsSDRQCKDE0UM0Qz3q8NkdJwPQMc7s3y9bgbrA==","signatures":[{"sig":"MEUCIHQO2K28c16gETjy40/S3iiBVuROJKP585O1D88MfY9pAiEApcyJOr7zlZUWUCENKVAmL/X6Pvjpafjy1nSu3vuAtGY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":175973},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a49cae6c1417d7c04fe2458b1c28d194e4ef0f53","scripts":{"test":"node --test","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"repository":{"url":"git+https://github.com/3kaiu/xbridge.git","type":"git","directory":"packages/xbridge-js"},"_npmVersion":"10.9.8","description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.4.0"},"_npmOperationalInternal":{"tmp":"tmp/xbridge-js_0.1.8_1788882234694_0.0007759772678574972","host":"s3://npm-registry-packages-npm-production"}},"0.1.9":{"name":"@3kaiu/xbridge-js","version":"0.1.9","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"sideEffects":false,"description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/3kaiu/xbridge.git","directory":"packages/xbridge-js"},"homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"node --test"},"devDependencies":{"typescript":"^5.4.0"},"_id":"@3kaiu/xbridge-js@0.1.9","gitHead":"2a404c6bf532607d739ef217d300bc690c1bf16a","_nodeVersion":"22.23.1","_npmVersion":"10.9.8","dist":{"integrity":"sha512-AZexP1Jhu2OVDskkdrLy0kbtV2mNKYd3JP4FPCM1xIicfqLH9KMZZxJtDAwX4gCIr39bughBLzrw8VVgePweMA==","shasum":"b77db3fa3296b5672f1f527b6fbfa4442a389ec9","tarball":"https://registry.npmjs.org/@3kaiu/xbridge-js/-/xbridge-js-0.1.9.tgz","fileCount":34,"unpackedSize":179374,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDTQ/r/rXN80t0aWQuew8jaybZ+swrTacfbnFmRJV7eRgIhANp8qcU7mIX9FywbRspNDP8XZ7KUmDeMow/ZnM6caDE9"}]},"_npmUser":{"name":"3kaiu","email":"npm@wenn.in"},"directories":{},"maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xbridge-js_0.1.9_1788938165228_0.14161145611388237"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-24T03:49:39.124Z","modified":"2026-09-09T07:16:05.558Z","0.1.0":"2026-07-24T03:49:39.461Z","0.1.1":"2026-08-31T02:50:08.211Z","0.1.2":"2026-09-01T03:17:24.542Z","0.1.3":"2026-09-01T12:13:23.690Z","0.1.4":"2026-09-02T09:08:37.473Z","0.1.5":"2026-09-03T06:25:57.392Z","0.1.6":"2026-09-04T10:57:00.053Z","0.1.7":"2026-09-08T14:29:01.854Z","0.1.8":"2026-09-08T15:43:54.813Z","0.1.9":"2026-09-09T07:16:05.378Z"},"bugs":{"url":"https://github.com/3kaiu/xbridge/issues"},"license":"MIT","homepage":"https://github.com/3kaiu/xbridge/tree/main/packages/xbridge-js","keywords":["bridge","webview","json-rpc","cross-platform","h5"],"repository":{"type":"git","url":"git+https://github.com/3kaiu/xbridge.git","directory":"packages/xbridge-js"},"description":"Open-source, zero-business-coupling cross-platform bridge SDK for H5.","maintainers":[{"name":"3kaiu","email":"npm@wenn.in"}],"readme":"# xbridge-js\n\nOpen-source, zero-business-coupling H5 bridge SDK. Implements a pure async\nJSON-RPC 2.0 variant protocol over `window.XBridge.postMessage`, with a\nuniversal `StandardAdapter` for any container (Flutter webview_flutter, native\nshells) that injects `window.XBridge`. No synchronous bypass and no third-party\nlegacy transport (dsbridge, XBridgeSync) is coupled in.\n\n## Install\n\n```sh\nnpm install @3kaiu/xbridge-js\n# or\npnpm add @3kaiu/xbridge-js\n```\n\n## Quick start\n\n```ts\nimport { XBridge } from \"@3kaiu/xbridge-js\";\n\nconst bridge = new XBridge();\n\n// Async RPC (Promise, JSON-RPC over the detected transport)\nconst info = await bridge.call(\"getDeviceInfo\");\n\n// Fire-and-forget (no id, no response expected)\nawait bridge.call(\"logEvent\", { foo: 1 }, { noCallback: true });\n\n// Subscribe to host-pushed events\nconst off = bridge.onEvent(\"onNetworkChange\", (params) => {\n  console.log(\"network changed\", params);\n});\n// later\noff();\n\n// Register a handler for Native → H5 calls\nconst unreg = bridge.registerHandler(\"getUserConfirmation\", (params) => {\n  return confirm(params?.message);\n});\n// later\nunreg();\n\n// Environment availability check\nif (bridge.isConnected()) {\n  console.log(\"Bridge transport is connected\");\n}\n\n// Direct fallback option: returns fallback value on transport error (no rejection)\nconst safeArea = await bridge.call(\"getSafeArea\", null, {\n  fallback: { top: 0, bottom: 0 },\n});\n\n// Or catch with XBridgeSendError\nimport { XBridgeSendError } from \"@3kaiu/xbridge-js\";\ntry {\n  const data = await bridge.call(\"getSafeArea\");\n} catch (err) {\n  if (err instanceof XBridgeSendError) {\n    // Graceful fallback when outside native container\n  }\n}\n\n// Re-sniff if the container injects window.XBridge after SDK init\nimport { resetSniffCache } from \"@3kaiu/xbridge-js\";\nresetSniffCache();\nconst bridge2 = new XBridge(); // picks up StandardAdapter now\n```\n\n## Auto-sniff order\n\nThe constructor probes `window` once (cached) and picks the first available\nadapter:\n\n1. `window.XBridge.postMessage` → `StandardAdapter` (async, bidirectional)\n2. `flutter_inappwebview.callHandler` / `__xbridge_ready__` → `StandardAdapter`\n3. none → `NoopAdapter` (warns \"no bridge environment\")\n\nOverride explicitly when you need to force a transport, e.g. for tests:\n\n```ts\nimport { XBridge, StandardAdapter } from \"@3kaiu/xbridge-js\";\n\nconst bridge = new XBridge({ adapter: new StandardAdapter() });\n```\n\n## Adapters\n\n| Adapter | Transport | Direction |\n| --- | --- | --- |\n| `StandardAdapter` | `window.XBridge.postMessage(str)` | async bidirectional via `window.__XBridge__.resolve/reject` + `window.__XBridgeInbound__` + `XBridgeEvent` |\n\n`StandardAdapter` installs global overrides that route host → H5 messages\ninto the core. The overrides are re-installed lazily on each `send()` call,\nso they survive host bootstrap re-injection.\n\n## Protocol\n\n```jsonc\n// H5 → Host\n{ \"jsonrpc\": \"2.0\", \"id\": \"<uuid>\", \"method\": \"getDeviceInfo\", \"params\": {} }\n\n// Host → H5 (response)\n{ \"jsonrpc\": \"2.0\", \"id\": \"<uuid>\", \"result\": \"...\" }\n{ \"jsonrpc\": \"2.0\", \"id\": \"<uuid>\", \"error\": { \"code\": -32000, \"message\": \"...\" } }\n\n// Host → H5 (event, no id)\n{ \"jsonrpc\": \"2.0\", \"method\": \"onNetworkChange\", \"params\": {} }\n```\n\n`XBRIDGE_PROTOCOL_VERSION` is exported as `\"2.0\"`.\n\n## Performance\n\n- Single installed message handler per adapter; inbound parsed once.\n- O(1) `Map` for pending-request correlation and event listeners.\n- `JSON.stringify` / `JSON.parse` only — no intermediate allocations.\n- `generateId()` uses native `crypto.randomUUID` when available (cached).\n- No runtime dependencies.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}