{"_id":"@blueyerobotics/jszmq","_rev":"5-440fd8bcf708180c3e37f388a845cd7b","name":"@blueyerobotics/jszmq","dist-tags":{"latest":"0.3.1"},"versions":{"0.1.3":{"name":"@blueyerobotics/jszmq","version":"0.1.3","author":"","license":"MPL-2.0","_id":"@blueyerobotics/jszmq@0.1.3","maintainers":[{"name":"arechi","email":"aglimbenli@gmail.com"},{"name":"follesoe","email":"jonas@follesoe.no"}],"homepage":"https://github.com/zeromq/jszmq#readme","bugs":{"url":"https://github.com/zeromq/jszmq/issues"},"dist":{"shasum":"29e55a2ead47872e2839286458e80a0883392d42","tarball":"https://registry.npmjs.org/@blueyerobotics/jszmq/-/jszmq-0.1.3.tgz","fileCount":91,"integrity":"sha512-1/tsMGPIt963eqM4cC9v+DLj5cb7IPSk8IbCrS6c42NskpYlSR8lTlkDyVPineg8iUhSp8QV8tPF7TQm3dIBJQ==","signatures":[{"sig":"MEUCICmXakj2blHuL6oj8Jxj9226ioumxNKl/WwJo8PyXGPWAiEA9LCAAWGL2uw+GNDd0aSYVD5UpWhQ8Mp2EuPfzIrsMaQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":176473},"main":"lib/index.js","_from":"file:blueyerobotics-jszmq-0.1.3.tgz","types":"lib/index.d.ts","scripts":{"test":"npm run build:test && jasmine --reporter=jasmine-console-reporter --config=jasmine.json","build":"tsc","check":"tsc -p tsconfig.json --noEmit","clear":"rm -rf lib/ dist/ coverage/ .nyc_output/","coverage":"nyc npm run test && nyc report --reporter=html","clear:all":"rm -rf node_modules/ npm-debug.log && npm run clear","coveralls":"nyc npm run test && nyc report --reporter=text-lcov | coveralls -v","build:test":"npm run clear && tsc -p tsconfig-test.json"},"_npmUser":{"name":"arechi","email":"aglimbenli@gmail.com"},"_resolved":"/private/var/folders/lz/p35w9zbd6_18jkf73qfrlz980000gn/T/6de92c7e4d4dfd6f2587fbc5c861ccae/blueyerobotics-jszmq-0.1.3.tgz","_integrity":"sha512-1/tsMGPIt963eqM4cC9v+DLj5cb7IPSk8IbCrS6c42NskpYlSR8lTlkDyVPineg8iUhSp8QV8tPF7TQm3dIBJQ==","repository":{"url":"git+https://github.com/zeromq/jszmq.git","type":"git"},"_npmVersion":"11.7.0","description":"Port of zeromq to Javascript over Web Socket transport","directories":{},"_nodeVersion":"25.4.0","dependencies":{"ws":"^7.3.1","assert":"^2.0.0","buffer":"^5.6.0","events":"^3.2.0","lodash":"^4.17.19","setasap":"^2.0.1","@types/ws":"^7.2.6","@types/events":"^3.0.0","@types/lodash":"^4.14.158","isomorphic-ws":"^4.0.1","@types/setasap":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","jasmine":"^3.6.1","ts-node":"^8.10.2","coveralls":"^3.1.0","typescript":"^5.9.3","@types/node":"^14.0.26","@types/jasmine":"^3.5.11","jasmine-console-reporter":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/jszmq_0.1.3_1774015038379_0.9737628008124353","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@blueyerobotics/jszmq","version":"0.2.0","author":"","license":"MPL-2.0","_id":"@blueyerobotics/jszmq@0.2.0","maintainers":[{"name":"arechi","email":"aglimbenli@gmail.com"},{"name":"follesoe","email":"jonas@follesoe.no"}],"homepage":"https://github.com/BluEye-Robotics/jszmq#readme","bugs":{"url":"https://github.com/BluEye-Robotics/jszmq/issues"},"dist":{"shasum":"80270df41b82ed51da30acbf3b47d1f75b7d79ee","tarball":"https://registry.npmjs.org/@blueyerobotics/jszmq/-/jszmq-0.2.0.tgz","fileCount":191,"integrity":"sha512-EX5CnzDSXrDwtdsjffHsi09Z+FRUVJt/TYiFt+xgqPhJ8jS2aiQdmxMkOF9KIGwFXz0Sw2MkP1tZwM9WX+aHug==","signatures":[{"sig":"MEUCIC5Q4dCr7T1CztT+w7EKkqmGNrWUK7n0IqMAJmobaeQpAiEA2yBarx84BPxcLkPk7nd0gu+/b8ylTP8JE+44yTfISxc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@blueyerobotics%2fjszmq@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":339597},"main":"lib/index.js","_from":"file:blueyerobotics-jszmq-0.2.0.tgz","types":"lib/index.d.ts","scripts":{"test":"npm run build:test && jasmine --reporter=jasmine-console-reporter --config=jasmine.json","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","clear":"rm -rf lib/ dist/ coverage/ .nyc_output/","coverage":"nyc npm run test && nyc report --reporter=html","clear:all":"rm -rf node_modules/ npm-debug.log && npm run clear","coveralls":"nyc npm run test && nyc report --reporter=text-lcov | coveralls -v","build:test":"npm run clear && tsc -p tsconfig-test.json"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8a33fc61-2398-4f4a-9e3a-458902fc6d44"}},"_resolved":"/tmp/1c03983d92646ff001bd5ac318d32f7c/blueyerobotics-jszmq-0.2.0.tgz","_integrity":"sha512-EX5CnzDSXrDwtdsjffHsi09Z+FRUVJt/TYiFt+xgqPhJ8jS2aiQdmxMkOF9KIGwFXz0Sw2MkP1tZwM9WX+aHug==","repository":{"url":"git+https://github.com/BluEye-Robotics/jszmq.git","type":"git"},"_npmVersion":"11.9.0","description":"Port of zeromq to Javascript over Web Socket transport","directories":{},"_nodeVersion":"24.14.0","dependencies":{"ws":"^7.3.1","assert":"^2.0.0","buffer":"^5.6.0","events":"^3.2.0","lodash":"^4.17.19","setasap":"^2.0.1","@types/ws":"^7.2.6","@types/events":"^3.0.0","@types/lodash":"^4.14.158","isomorphic-ws":"^4.0.1","@types/setasap":"^2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"nyc":"^15.1.0","jasmine":"^3.6.1","ts-node":"^8.10.2","coveralls":"^3.1.0","typescript":"^5.9.3","@types/node":"^14.0.26","@types/jasmine":"^3.5.11","jasmine-console-reporter":"^3.1.0"},"_npmOperationalInternal":{"tmp":"tmp/jszmq_0.2.0_1774017356462_0.03957482763511222","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@blueyerobotics/jszmq","version":"0.3.0","author":"","license":"MPL-2.0","_id":"@blueyerobotics/jszmq@0.3.0","maintainers":[{"name":"juanpi96","email":"juanpi.96.b@gmail.com"},{"name":"arechi","email":"aglimbenli@gmail.com"},{"name":"follesoe","email":"jonas@follesoe.no"}],"homepage":"https://github.com/BluEye-Robotics/jszmq#readme","bugs":{"url":"https://github.com/BluEye-Robotics/jszmq/issues"},"dist":{"shasum":"5ae62bad3badd0efede50cbdbeced5c467a60088","tarball":"https://registry.npmjs.org/@blueyerobotics/jszmq/-/jszmq-0.3.0.tgz","fileCount":99,"integrity":"sha512-wyWLFAR2pPFsc3hAR1A9hfJTvXE29DaFQ/NWTOURe9m6qQ0wOv92sRdMYWzr+GkfVNWbGeYzc1+w2rwOU4ueqg==","signatures":[{"sig":"MEYCIQDzs/BtDeXvQj+0CpjTf0fm1m2303LKAp6V4+PpPxW/JwIhAOwpMKDsdaxjpvYFElq7rQpRNBfldBHFoRVxhzNqbjtT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@blueyerobotics%2fjszmq@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":153445},"type":"module","_from":"file:blueyerobotics-jszmq-0.3.0.tgz","types":"./lib/index.d.ts","engines":{"node":">=22"},"exports":{".":"./lib/index.js","./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","clear":"rm -rf lib/ coverage/","coverage":"vitest run --coverage","clear:all":"rm -rf node_modules/ npm-debug.log && npm run clear","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8a33fc61-2398-4f4a-9e3a-458902fc6d44"}},"_resolved":"/tmp/a9f583c70e976f558a5c261e3b92367a/blueyerobotics-jszmq-0.3.0.tgz","_integrity":"sha512-wyWLFAR2pPFsc3hAR1A9hfJTvXE29DaFQ/NWTOURe9m6qQ0wOv92sRdMYWzr+GkfVNWbGeYzc1+w2rwOU4ueqg==","repository":{"url":"git+https://github.com/BluEye-Robotics/jszmq.git","type":"git"},"_npmVersion":"11.11.0","description":"Port of zeromq to Javascript over Web Socket transport","directories":{},"sideEffects":false,"_nodeVersion":"24.14.1","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3","@types/ws":"^8.5.10","typescript":"^6","@types/node":"^22","@vitest/coverage-v8":"^3"},"_npmOperationalInternal":{"tmp":"tmp/jszmq_0.3.0_1777545065357_0.4589482634951205","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"_id":"@blueyerobotics/jszmq@0.3.1","bugs":{"url":"https://github.com/BluEye-Robotics/jszmq/issues"},"dist":{"shasum":"0596ea2a805ef17aec17b81ee643a0e9173da04f","tarball":"https://registry.npmjs.org/@blueyerobotics/jszmq/-/jszmq-0.3.1.tgz","fileCount":99,"integrity":"sha512-g+dsbaTrbsHz9vOCQ37pNCXN15rLVrS12eRvTavJBgBX9cPt3vn/6abp7eqJoTP0RzNduqq9IeBX9zO4gEeTnw==","signatures":[{"sig":"MEYCIQC5vbj5clhxrtgiI1OCoY0ZbZ7zU/jJSLfbOou4TxDJ+AIhAIz4f1FxymHXQC7dddOzU9WxmnCCHKHU52EYPjSrc3Nz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF2hekIG2fRWgQfhZTKmWrjiYav6TK9oWpJOjvywAHs3AiBKZf61GwS1pvBl/Z6s+pM+Ki9bdG6rGvEYVzoTMGH6Lg=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@blueyerobotics%2fjszmq@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":153827},"name":"@blueyerobotics/jszmq","type":"module","_from":"file:blueyerobotics-jszmq-0.3.1.tgz","types":"./lib/index.d.ts","author":"","engines":{"node":">=22"},"exports":{".":"./lib/index.js","./package.json":"./package.json"},"license":"MPL-2.0","scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","check":"tsc -p tsconfig.json --noEmit","clear":"rm -rf lib/ coverage/","coverage":"vitest run --coverage","clear:all":"rm -rf node_modules/ npm-debug.log && npm run clear","test:watch":"vitest"},"version":"0.3.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8a33fc61-2398-4f4a-9e3a-458902fc6d44"}},"homepage":"https://github.com/BluEye-Robotics/jszmq#readme","_resolved":"/tmp/7ad836ebadf6421da008e1cb6c3c31b5/blueyerobotics-jszmq-0.3.1.tgz","_integrity":"sha512-g+dsbaTrbsHz9vOCQ37pNCXN15rLVrS12eRvTavJBgBX9cPt3vn/6abp7eqJoTP0RzNduqq9IeBX9zO4gEeTnw==","repository":{"url":"git+https://github.com/BluEye-Robotics/jszmq.git","type":"git"},"_npmVersion":"11.19.0","description":"Port of zeromq to Javascript over Web Socket transport","directories":{},"maintainers":[{"name":"juanpi96","email":"juanpi.96.b@gmail.com"},{"name":"arechi","email":"aglimbenli@gmail.com"},{"name":"follesoe","email":"jonas@follesoe.no"}],"sideEffects":false,"_nodeVersion":"24.21.0","dependencies":{"ws":"^8.18.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3","@types/ws":"^8.5.10","typescript":"^6","@types/node":"^22","@vitest/coverage-v8":"^3"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jszmq_0.3.1_1790333628890_0.3491659353099086"}}},"time":{"created":"2026-03-20T13:57:18.319Z","modified":"2026-09-25T10:53:49.306Z","0.1.3":"2026-03-20T13:57:18.524Z","0.2.0":"2026-03-20T14:35:56.640Z","0.3.0":"2026-04-30T10:31:05.511Z","0.3.1":"2026-09-25T10:53:48.977Z"},"bugs":{"url":"https://github.com/BluEye-Robotics/jszmq/issues"},"license":"MPL-2.0","homepage":"https://github.com/BluEye-Robotics/jszmq#readme","repository":{"url":"git+https://github.com/BluEye-Robotics/jszmq.git","type":"git"},"description":"Port of zeromq to Javascript over Web Socket transport","maintainers":[{"name":"juanpi96","email":"juanpi.96.b@gmail.com"},{"name":"arechi","email":"aglimbenli@gmail.com"},{"name":"follesoe","email":"jonas@follesoe.no"}],"readme":"jszmq\n======\n\njszmq is a port of zeromq to JavaScript, focused on **browser** runtimes via the WebSocket transport ([ZWS 2.0](https://rfc.zeromq.org/spec:45/ZWS/)).\n\nThe API mirrors [zeromq.js](https://github.com/zeromq/zeromq.js).\n\n## Requirements\n\n- Browser-first: consumed through a bundler (Vite, webpack, esbuild, tsx, etc.). The package ships ESM only with extensionless internal imports.\n- Node ≥22 if used server-side (relies on the global `WebSocket`).\n\n## Compatibility with ZeroMQ\n\nThe WebSocket transport is supported by [zeromq](https://github.com/zeromq/libzmq) when compiled from source.\n\nOther ports of zeromq (NetMQ for C#, JeroMQ for Java) don't yet support the WebSocket transport.\n\n## Compatibility with ZWS 1.0, zwssock, JSMQ and NetMQ.WebSockets\n\nNot compatible with ZWS 1.0.\n\n## Installation\n\n```\npnpm add @blueyerobotics/jszmq\n```\n\n## Supported socket types\n\n* Pub\n* Sub\n* XPub\n* XSub\n* Dealer\n* Router\n* Req\n* Rep\n* Push\n* Pull\n* Pair\n\n## How to use\n\n```js\nimport * as zmq from '@blueyerobotics/jszmq'\n```\n\n### Creating a socket\n\nEither via the socket type class:\n\n```js\nconst dealer = new zmq.Dealer()\n```\n\nor via the `socket` factory (matches zeromq.js):\n\n```js\nconst dealer = zmq.socket('dealer')\n```\n\n### Bind\n\n`bind` is **Node-only** (it starts a WebSocket server). Browsers can only `connect`.\n\n```js\nimport { Router } from '@blueyerobotics/jszmq'\n\nconst router = new Router()\nrouter.bind('ws://localhost:80')\n```\n\nYou can also share an existing HTTP server across multiple sockets:\n\n```js\nimport { createServer } from 'http'\nimport { Rep, Pub } from '@blueyerobotics/jszmq'\n\nconst server = createServer()\n\nconst rep = new Rep()\nconst pub = new Pub()\n\nrep.bind('ws://localhost:80/reqrep', server)\npub.bind('ws://localhost:80/pubsub', server)\n\nserver.listen(80)\n```\n\n`bindSync` is an alias for `bind`, kept for zeromq.js compatibility.\n\n### Sending\n\n`send` accepts a single frame or an array of frames. Each frame is either a `string` (encoded as UTF-8) or a `Uint8Array`.\n\n```js\nsocket.send('Hello')                                      // single frame\nsocket.send(['Hello', 'World'])                           // multiple frames\nsocket.send([new TextEncoder().encode('Hello')])          // raw bytes\n```\n\n### Receiving\n\nSockets emit a `message` event. Each frame is passed as a separate argument to the listener; every frame is a `Uint8Array`.\n\n```js\nconst decode = (b) => new TextDecoder().decode(b)\n\nsocket.on('message', msg => console.log(decode(msg)))                              // one frame\nsocket.on('message', (a, b) => console.log(decode(a), decode(b)))                  // two frames\nsocket.on('message', (...frames) => frames.forEach(f => console.log(decode(f))))   // any number\n```\n\n## Examples\n\n### Push/Pull\n\nA producer pushes work onto a socket and a worker pulls it.\n\n**producer.js**\n\n```js\nimport { Push } from '@blueyerobotics/jszmq'\n\nconst sock = new Push()\nsock.bind('ws://127.0.0.1:3000')\nconsole.log('Producer bound to port 3000')\n\nsetInterval(() => {\n  console.log('sending work')\n  sock.send('some work')\n}, 500)\n```\n\n**worker.js**\n\n```js\nimport { Pull } from '@blueyerobotics/jszmq'\n\nconst decode = (b) => new TextDecoder().decode(b)\nconst sock = new Pull()\nsock.connect('ws://127.0.0.1:3000')\nconsole.log('Worker connected to port 3000')\n\nsock.on('message', msg => {\n  console.log('work:', decode(msg))\n})\n```\n\n### Pub/Sub\n\n**Publisher: pubber.js**\n\n```js\nimport { Pub } from '@blueyerobotics/jszmq'\n\nconst sock = new Pub()\nsock.bind('ws://127.0.0.1:3000')\nconsole.log('Publisher bound to port 3000')\n\nsetInterval(() => {\n  console.log('sending a multipart message envelope')\n  sock.send(['kitty cats', 'meow!'])\n}, 500)\n```\n\n**Subscriber: subber.js**\n\n```js\nimport { Sub } from '@blueyerobotics/jszmq'\n\nconst decode = (b) => new TextDecoder().decode(b)\nconst sock = new Sub()\nsock.connect('ws://127.0.0.1:3000')\nsock.subscribe('kitty cats')\nconsole.log('Subscriber connected to port 3000')\n\nsock.on('message', (topic, message) => {\n  console.log('topic:', decode(topic), 'message:', decode(message))\n})\n```\n","readmeFilename":"README.md"}