{"_id":"sync-message","_rev":"4548530","name":"sync-message","description":"Synchronous communication between the main browser thread and web workers","dist-tags":{"latest":"0.0.12"},"maintainers":[{"name":"alexmojaki","email":""}],"time":{"modified":"2026-04-09T16:44:00.000Z","created":"2022-01-29T09:36:17.402Z","0.0.12":"2023-09-10T12:26:58.135Z","0.0.11":"2023-09-10T11:04:34.521Z","0.0.10":"2022-04-18T11:57:14.474Z","0.0.9":"2022-03-06T19:36:14.432Z","0.0.8":"2022-02-12T12:07:43.430Z","0.0.7":"2022-02-12T10:57:29.353Z","0.0.6":"2022-02-12T10:27:51.507Z","0.0.5":"2022-02-05T10:58:12.382Z","0.0.4":"2022-02-05T10:35:35.244Z","0.0.3":"2022-01-30T10:22:21.159Z","0.0.2":"2022-01-29T11:29:15.604Z","0.0.1":"2022-01-29T09:36:17.402Z"},"users":{},"author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"versions":{"0.0.12":{"name":"sync-message","version":"0.0.12","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"150da56dd17a052f24c0edbdfb1af97a88facc69","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.12","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"shasum":"5e4fd5c025ba4be7b04d7237662d9948085bf7ce","size":14050,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.12.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.12.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.12_1694348817897_0.23429027775382427"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-10T12:26:58.135Z","publish_time":1694348818135,"_source_registry_name":"default","_cnpm_publish_time":1694348818135},"0.0.11":{"name":"sync-message","version":"0.0.11","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"1ed0648c0f146cbe1ead1cd2a38e322b718624a7","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.11","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"shasum":"a848a396124ac64b69dda1e7ba66d45e5719a75e","size":14030,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.11.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.11.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.11_1694343874318_0.14180524759598367"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-09-10T11:04:34.521Z","publish_time":1694343874521,"_source_registry_name":"default","_cnpm_publish_time":1694343874521},"0.0.10":{"name":"sync-message","version":"0.0.10","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"ca2bb6bf021072b76cd5a12898da0de6bd431a3a","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.10","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"ef325fc67c62d24ab10bb0eea79b28d3ba6be403","size":14208,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.10.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.10.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.10_1650283034295_0.6746646880027305"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-04-18T11:57:21.524Z","publish_time":1650283034474,"_cnpm_publish_time":1650283034474},"0.0.9":{"name":"sync-message","version":"0.0.9","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"1d525910a0b488c18dbf12b9a02d088ae73d8a89","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.9","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"8da80c1103b5eb688729e22d9480b8a59c83aa5d","size":7075,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.9.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.9_1646595374096_0.9305056604250144"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-03-06T19:36:17.848Z","publish_time":1646595374432,"_cnpm_publish_time":1646595374432},"0.0.8":{"name":"sync-message","version":"0.0.8","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"647b9685189b99be005bc9a6af5d86988c45d5eb","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.8","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"ca20723cd85fe819284ce82de3797ca108b02659","size":14156,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.8.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.8_1644667663212_0.30954081279911994"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-12T12:07:50.589Z","publish_time":1644667663430,"_cnpm_publish_time":1644667663430},"0.0.7":{"name":"sync-message","version":"0.0.7","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"de3ee5ce33224372861d4e4e33fb77f71ff786b7","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.7","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"05f442c1d6e9b2edac38e598d56dc5130e2983be","size":13571,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.7.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.7_1644663449219_0.659084541920484"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-12T10:57:33.890Z","publish_time":1644663449353,"_cnpm_publish_time":1644663449353},"0.0.6":{"name":"sync-message","version":"0.0.6","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.ts","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"18fd49f2de2cfe1bf20c9804479dd72292138d0f","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.6","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"f8b2663b8ac44912f38ea7ea4ce871c598faf2bb","size":13570,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.6.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.6_1644661671335_0.20942920368283002"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-12T10:27:56.716Z","publish_time":1644661671507,"_cnpm_publish_time":1644661671507},"0.0.5":{"name":"sync-message","version":"0.0.5","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"1b6dc887b616bdbd8adbc08f06ee1b6ca0c21d7e","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.5","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"59dc39a5005707390e22ae78b657768645773ca1","size":12345,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.5.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.5_1644058692225_0.4999064979350625"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-05T10:58:18.838Z","publish_time":1644058692382,"_cnpm_publish_time":1644058692382},"0.0.4":{"name":"sync-message","version":"0.0.4","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/index.js","types":"dist/lib/index.d.ts","module":"lib/","scripts":{"build":"rm -rf dist/ && webpack --mode production","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","ts-loader":"^9.2.6","typescript":"^4.5.5","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"1b6dc887b616bdbd8adbc08f06ee1b6ca0c21d7e","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.4","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"43013d5f7d7944926d9bc0f9710ad82c746eb145","size":14000,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.4.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.4_1644057334826_0.06526945860442002"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-02-05T10:35:39.160Z","publish_time":1644057335244,"_cnpm_publish_time":1644057335244},"0.0.3":{"name":"sync-message","version":"0.0.3","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/","module":"lib/","scripts":{"build":"babel lib/ -d dist/ --source-maps --ignore '**/*.test.js' --delete-dir-on-start","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"bracketSpacing":false,"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"68fb03c227a809673f8388c71dc3e4eaa97d6cad","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.3","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"d4d4096dfb74703558c651543a4fee4eb2579cb3","size":7935,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.3.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.3_1643538141025_0.16494274757024052"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-30T10:22:30.331Z","publish_time":1643538141159,"_cnpm_publish_time":1643538141159},"0.0.2":{"name":"sync-message","version":"0.0.2","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/","module":"lib/","scripts":{"build":"babel lib/ -d dist/ --source-maps --ignore '**/*.test.js' --delete-dir-on-start","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"afa4178e960db3346927939a1b1eb4f32a563ebe","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.2","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"8362efe39092c0d80a003be1f4f6cbc5f9aea313","size":6174,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.2.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.2_1643455755317_0.5356731119113984"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-29T11:29:21.531Z","publish_time":1643455755604,"_cnpm_publish_time":1643455755604},"0.0.1":{"name":"sync-message","version":"0.0.1","private":false,"description":"Synchronous communication between the main browser thread and web workers","repository":{"type":"git","url":"git+https://github.com/alexmojaki/sync-message.git"},"license":"MIT","author":{"name":"Alex Hall","email":"alex.mojaki@gmail.com"},"sideEffects":false,"main":"dist/","module":"lib/","scripts":{"build":"babel lib/ -d dist/ --source-maps --ignore '**/*.test.js' --delete-dir-on-start","format":"prettier --write '**/*.*' && eslint . --fix","lint":"prettier --check '**/*.*' && eslint .","prepare":"yarn build","semantic-release":"semantic-release"},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"12"}}]]},"prettier":{"trailingComma":"all"},"eslintConfig":{"env":{"browser":true,"es6":true,"node":true},"parser":"babel-eslint","parserOptions":{"ecmaVersion":2019,"sourceType":"module"},"extends":["eslint:recommended"],"rules":{"no-constant-condition":[2,{"checkLoops":false}]},"globals":{"Atomics":"readonly","SharedArrayBuffer":"readonly"}},"dependencies":{},"devDependencies":{"@babel/cli":"7.12.17","@babel/core":"7.12.17","@babel/preset-env":"7.12.17","babel-eslint":"10.1.0","comlink":"^4.3.1","eslint":"7.32.0","html-webpack-plugin":"^5.5.0","prettier":"2.1.2","prettier-plugin-packagejson":"2.2.13","semantic-release":"17.2.4","semantic-release-cli":"5.4.4","webpack":"^5.66.0","webpack-cli":"^4.9.1","webpack-dev-server":"^4.7.3","worker-loader":"^3.0.8"},"renovate":{"extends":["config:js-lib",":automergePatch",":automergeBranch",":automergePatch",":automergeBranch",":automergeLinters",":automergeTesters",":automergeTypes"]},"gitHead":"9b968f863c1fc6c77e081ec0c552730c2d3f906a","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"homepage":"https://github.com/alexmojaki/sync-message#readme","_id":"sync-message@0.0.1","_nodeVersion":"14.15.4","_npmVersion":"6.14.10","dist":{"shasum":"146a2eb4e4369e47cdec2ef501c53cb4f1d9c4a1","size":6077,"noattachment":false,"key":"/sync-message/-/sync-message-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/sync-message/download/sync-message-0.0.1.tgz"},"_npmUser":{"name":"alexmojaki","email":"alex.mojaki@gmail.com"},"directories":{},"maintainers":[{"name":"alexmojaki","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sync-message_0.0.1_1643448977245_0.5464120947719242"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-01-29T09:36:21.840Z","publish_time":1643448977402,"_cnpm_publish_time":1643448977402}},"readme":"# sync-message\n\n[![GitHub license](https://img.shields.io/github/license/alexmojaki/sync-message?style=flat)](https://github.com/alexmojaki/sync-message/blob/master/LICENSE) [![Tests](https://github.com/alexmojaki/sync-message/workflows/CI/badge.svg)](https://github.com/alexmojaki/sync-message/actions)\n\n[![NPM](https://nodei.co/npm/sync-message.png)](https://npmjs.org/package/sync-message)\n\nA small library for synchronous communication between the main browser thread and web workers using `Atomics` and/or service workers. In particular you can use the `readMessage` function inside a web worker to **synchronously** receive data from the browser thread.\n\n## Usage outline\n\n1. Setup your application to support at least one of the two types of channel:\n   - To enable channels using `Atomics` and `SharedArrayBuffer`, [enable cross-origin isolation](https://web.dev/cross-origin-isolation-guide/#enable-cross-origin-isolation). Note that even with cross-origin isolation, browser support is still shaky.\n   - To enable channels using service workers, register a service worker script which uses this library's [`serviceWorkerFetchListener`](#serviceworkerfetchlistener).\n2. Create a channel object with [`makeChannel`](#makechannel).\n3. Send the channel object to your web worker via the standard `postMessage` or your favourite wrapper library such as `Comlink`.\n4. When the worker needs to get data from the main thread:\n   1. In the worker, send a unique `messageId` string back to the main thread, again with the usual `postMessage` etc. The function `uuidv4` is provided to make this easy.\n   2. Still in the worker, call [`readMessage(channel, messageId, options)`](#readmessage) which will block until it receives and returns a message.\n   3. In the main thread, use the `messageId` sent in step 1 to call [`writeMessage(channel, message, messageId)`](#writemessage). `message` will be encoded and decoded using `JSON`.\n\nSo your code in the main thread should look something like this:\n\n```js\nimport {makeChannel, writeMessage} from \"sync-message\";\n\nconst channel = makeChannel();\n\n// If you want to use a service worker channel\nnavigator.serviceWorker.register(\"service-worker.js\");\n\n// Send the channel to the web worker\nworker.postMessage({channel});\n\n// Receive a messageId from the worker and write a message when you're ready\nwriteMessage(channel, message, messageId);\n```\n\nIn your web worker:\n\n```js\nimport {readMessage, uuidv4} from \"sync-message\";\n\n// Generate a unique messageId string\nconst messageId = uuidv4();\n\n// Send it to the main thread so that they can call writeMessage as above\npostMessage({messageId});\n\n// Receive the message passed to  writeMessage\nconst message = readMessage(channel, messageId);\n```\n\nIn your service worker script if you have one:\n\n```js\nimport {serviceWorkerFetchListener} from \"sync-message\";\n\nconst fetchListener = serviceWorkerFetchListener();\n\naddEventListener(\"fetch\", function (e) {\n  if (fetchListener(e)) {\n    // This event has been handled by this library\n    return;\n  }\n  // Otherwise, add your own service worker logic here,\n  // e.g. passthrough to a normal network request:\n  e.respondWith(fetch(e.request));\n});\n```\n\n## Reference\n\n### `makeChannel`\n\nAccepts one optional argument `options` with two optional keys for configuring the different types of channel:\n\n- `atomics` has one option:\n  - `bufferSize`: number of bytes to allocate for the `SharedArrayBuffer`. Defaults to 128KiB. `writeMessage` will throw an error if the message is larger than the buffer size.\n- `serviceWorker` has the following options:\n  - `scope`: a string representing the prefix of a path/URL, defaulting to `\"/\"`. Both `readMessage` and `writeMessage` will make requests that start with this value so make sure that your service worker is controlling the page and can intercept those requests. The `scope` property of the registration object returned by `navigator.serviceWorker.register` should work.\n  - `timeout`: number of milliseconds representing a grace period for the service worker to start up. If requests made by `readMessage` and `writeMessage` fail, they will be retried until this timeout is exceeded, at which point they will throw an error.\n\nIf `SharedArrayBuffer` is available, `makeChannel` will use it to create an `atomics` type channel. Otherwise, if `navigator.serviceWorker` is available, it will create a `serviceWorker` type channel, but registering the service worker is up to you. If that's not available either, it'll return `null`.\n\nChannel objects have a `type` property which is either `\"atomics\"` or `\"serviceWorker\"`. The other properties are for internal use.\n\nIf you want to control the type of channel, you can call `makeAtomicsChannel({bufferSize?})` or `makeServiceWorkerChannel({scope?, timeout?})` directly.\n\nA single channel object shouldn't be used by multiple workers simultaneously, i.e. you should only read/write one message at a time.\n\n### `writeMessage`\n\nCall this in the browser's main UI thread to send a message to the worker reading from the channel with `readMessage`. Takes three arguments:\n\n- `channel`: a non-null object returned by `makeChannel`, `makeAtomicsChannel`, or `makeServiceWorkerChannel`.\n- `message`: any object that can be safely passed to `JSON.stringify` and then decoded with `JSON.parse`.\n- `messageId`: a unique string identifying the message that the worker is waiting for. Currently only used by service worker channels.\n\n### `readMessage`\n\nCall this in a web worker to synchronously receive a message sent by the main thread with `writeMessage`. Takes three arguments:\n\n- `channel`: a non-null object returned by `makeChannel`, `makeAtomicsChannel`, or `makeServiceWorkerChannel`. Should be created once in the main thread and then sent to the worker.\n- `messageId`: a unique string identifying the message that the worker is waiting for. Currently only used by service worker channels. Typically created in the worker using the `uuidv4` function and then sent to the main thread *before* calling `readMessage`.\n- `options`: an optional object with the following optional keys:\n  - `timeout`: a number of milliseconds. If this much time elapses without receiving a message, `readMessage` will return `null`.\n  - `checkInterrupt`: a function which may be called regularly while `readMessage` is checking for messages on the channel. If it returns `true`, then `readMessage` will return `null`.\n\n### `serviceWorkerFetchListener`\n\nCall this once in a service worker script. Returns a function which accepts a fetch event and responds to requests made by `readMessage` and `writeMessage`. If you don't need to use a service worker for anything else, you can simply write:\n\n```js\naddEventListener(\"fetch\", serviceWorkerFetchListener());\n```\n\nOtherwise, create a listener function *once* and then reuse it:\n\n```js\nimport {serviceWorkerFetchListener} from \"sync-message\";\n\nconst fetchListener = serviceWorkerFetchListener();\n\naddEventListener(\"fetch\", function (e) {\n  if (fetchListener(e)) {\n    // This event has been handled by this library\n    return;\n  }\n  // Otherwise, add your own service worker logic here,\n  // e.g. passthrough to a normal network request:\n  e.respondWith(fetch(e.request));\n});\n```\n","_attachments":{},"homepage":"https://github.com/alexmojaki/sync-message#readme","bugs":{"url":"https://github.com/alexmojaki/sync-message/issues"},"license":"MIT"}