{"_id":"webwackify","_rev":"14-160517a590fc8f863391abe164711288","name":"webwackify","description":"launch a web worker that can require() in the browser with browserify and webpack","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.1":{"name":"webwackify","version":"0.1.1","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/mjneil/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"e03285bb1d23d18af97730b5904e52a6512b020d","bugs":{"url":"https://github.com/mjneil/webwackify/issues"},"homepage":"https://github.com/mjneil/webwackify#readme","_id":"webwackify@0.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-rjmgh+3j5U/azq65YExpHIQebqVvM112wp8fjOVFoci21SjDCIKxO3C5Rr3AfD0KCmC+ZG+Tc757522hQ6GJLg==","shasum":"d0c6be6eb52f54ba3fcd30ae2f1bdbae7c2d28f3","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEzKSy6I0esVI++leBIFQ2xX05n7/pNbGGU8Z+DDr58wIgOjB6oZvesBbKvN7ZfiCbasFiUAe6Xd1uukw03hiBO5g="}]},"maintainers":[{"name":"mjneil","email":"mneilweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify-0.1.1.tgz_1517865840358_0.9310619323514402"},"directories":{}},"0.1.2":{"name":"webwackify","version":"0.1.2","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"1663263f483f4aa43865d7907f128b54ba98bb36","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-dBZpTBMjVgnHfKfblEbw7BPEyxygQk1UdoOlNH7YzWi0op/DZOjt3Gyu7rmESIkbaAygrOv+EpKEQdTSQePmZw==","shasum":"a65e851ecb0f10cf36cfb2e63db46c54759ab922","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHM3A/IoFIJRD3ipuyyYyDhP+WLDBXbqolpU20qSzmZJAiBHr2g7pmEEM4U98cMpt0ekMa83kye10k1qbdjWEQzHWQ=="}]},"maintainers":[{"name":"mjneil","email":"mneilweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify-0.1.2.tgz_1517866140472_0.1372101225424558"},"directories":{}},"0.1.3":{"name":"webwackify","version":"0.1.3","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"24ddcadc39074a10cea25cd5c09b105963f6407e","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.3","_npmVersion":"5.7.1","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-ttgVaQAd+9kYmZxgAuP8LMlYQRwDa8CujTEIxjXzb/XzMkF9Rg5jN7J4tus1kJvFHeINDa0MlM3pZqR+iRmkAg==","shasum":"f1a5f346a7e7871a479b10ff86b90689101a3653","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.3.tgz","fileCount":4,"unpackedSize":11511,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxJdC/V8QFNNg02kyjDfU2MFGrRyYI/JPfGeUD/YcLjgIhAM+MhfuJUGaBeLhS+fnaEBIlQZdC9JSQ+DV2h2AOeZai"}]},"maintainers":[{"email":"joseph.a.forbes@gmail.com","name":"forbesjo"},{"email":"gesinger@gmail.com","name":"gesinger"},{"email":"me@gkatsev.com","name":"gkatsev"},{"email":"mneilweb@gmail.com","name":"mjneil"},{"email":"okaramia@gmail.com","name":"okaramian"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify_0.1.3_1520365334263_0.1507763770498809"},"_hasShrinkwrap":false},"0.1.4":{"name":"webwackify","version":"0.1.4","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"3df9cc9f17493fbc7e787245645555ec02453bb9","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-D1yq20nwqY4oRDp0lReF3Kzr6oZh7d7lRGtgScWIYY5NurI58siE70RXnT8rJdMpXcWuotKUl4Y1dUAHy+8zgQ==","shasum":"1a9db822d6164af9103099934e1e69c4917056ac","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.4.tgz","fileCount":4,"unpackedSize":11615,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEHGZ9Z73tId55jnmX7yP380dINUglx8dlptceAq/S9IAiBuccRRkNhCbArlEeKUGMEaf6DBFdN2b2WA6gPqO0IC5A=="}]},"maintainers":[{"email":"joseph.a.forbes@gmail.com","name":"forbesjo"},{"email":"gesinger@gmail.com","name":"gesinger"},{"email":"me@gkatsev.com","name":"gkatsev"},{"email":"mneilweb@gmail.com","name":"mjneil"},{"email":"okaramia@gmail.com","name":"okaramian"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify_0.1.4_1521135626937_0.46160426168747914"},"_hasShrinkwrap":false},"0.1.5":{"name":"webwackify","version":"0.1.5","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"3cf43a35ad51387e1dcc04581bb01be8101c8265","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-lWPhJ9nndaLZM4J+0W9/N1jJtR56VI7UsYfa9nL+dLBQcKw+skgUPirYSEUoCjX7A6I+S2Cwwx6NHWxAtr3dDw==","shasum":"2cb5bde0d77d0ea80a6d3b30f8d0712bb2643205","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.5.tgz","fileCount":4,"unpackedSize":11574,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdXiwlgWlrelf/PwRWX8PUEuIEYGk9rIQhFp92HIoplwIgUjtb5LdGPP/OqizGUZMtawjyYeG353H7kk2ki2qZtmo="}]},"maintainers":[{"email":"joseph.a.forbes@gmail.com","name":"forbesjo"},{"email":"gesinger@gmail.com","name":"gesinger"},{"email":"me@gkatsev.com","name":"gkatsev"},{"email":"mneilweb@gmail.com","name":"mjneil"},{"email":"okaramia@gmail.com","name":"okaramian"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify_0.1.5_1521152303960_0.4669306396660624"},"_hasShrinkwrap":false},"0.1.6":{"name":"webwackify","version":"0.1.6","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"73d8accf8a982dd8a7adb7ca49a8a352590885a7","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"mjneil","email":"mneilweb@gmail.com"},"dist":{"integrity":"sha512-pGcw1T3HpNnM/UTRQqqRkkkzythSLts05mB+7Gr00B+0VbL0m39dFL5g20rSIEUt9Wrpw+/8k+snxRlUFHhcqA==","shasum":"1d42a12ac61823d7e345abde084eaaa62a4a95eb","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.6.tgz","fileCount":4,"unpackedSize":11253,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdWDXZBP0ipM6OeAsDjNIExhOIL+Q4BuraayXhcC+SjAiEAvo0xeTyfKwnfhBeYsxIl9V3hJbDc9blqMNsUAfGPal8="}]},"maintainers":[{"email":"joseph.a.forbes@gmail.com","name":"forbesjo"},{"email":"gesinger@gmail.com","name":"gesinger"},{"email":"me@gkatsev.com","name":"gkatsev"},{"email":"mneilweb@gmail.com","name":"mjneil"},{"email":"okaramia@gmail.com","name":"okaramian"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify_0.1.6_1521575461310_0.9596631149157522"},"_hasShrinkwrap":false},"0.1.7":{"name":"webwackify","version":"0.1.7","description":"launch a web worker that can require() in the browser with browserify and webpack","main":"index.js","dependencies":{},"repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"license":"MIT","gitHead":"fb8985cefce82f53747b74a51da511ae39618e21","bugs":{"url":"https://github.com/videojs/webwackify/issues"},"homepage":"https://github.com/videojs/webwackify#readme","_id":"webwackify@0.1.7","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-V9dO6/ptlk1IrgBBuKH0xKMvxwgejXIMuRCC+spHOS/Ee/+4uVhy9vhWgDbli8gax7tS91YzjMFQXMO9Bkj8mA==","shasum":"6ab21f10db2a62166aadc17b3aab27685a141dfc","tarball":"https://registry.npmjs.org/webwackify/-/webwackify-0.1.7.tgz","fileCount":4,"unpackedSize":11371,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhplVUCRA9TVsSAnZWagAAH6MP/2ojHtyEGIQZZwTvE22R\ncMT6/O+kM5tfEK0QOFe1qNk0lsKWvR4332aSpXP2sKHJFYt93CkBe8mJXyYn\nXm0kxJ+uRH7TsBbq2LS3XJI7WRcPrJVC9Rtuo6EiiYd90NpdC76vCuYN/ROU\n3juwk0tR+SUdDd/gbDL+70HsXnEAPQ2xprt9SXLUxCy2qfwvzmnFcZ+MlDQ7\nLz5dc0+3EuujsD3yu0JQyzap+dTLQa2JsQS+0qet2RePKpmoHUo1gEzGoyyh\n7ZM4nfpMzEAiN/VtDiK1VoO+kQ/5NRTRORc67UMUf68kCoxRJtPB8gLRVrk5\nyTi/IR9Ed2LqLD7FWvnU0VVL/R9T9FzwLsdXWcq0a8lsLDS17FD6BDCZX83T\nssPFMX1SlObMrANUb8CeTbCQMsF5IBbrVRwDQCQjAxyLPI/qbcA6jyKxC0IJ\n3srHBnWecgAJDg3N13V9FLjksBocy5+QRoPyZOBzcpo+Xbtc4eq6i7IYJZiR\n/WvKNgpmzMl0wFgNgcz2XEj8rH0D9zeeeeiGknuc+HdAyNio/pGuvlGA6Nu1\nT8uK2XIpRisFhQw/6h7xOj7imxaIOs16UaDUTf7rrxaBK7v+mQVqYzg51v1e\n5SJT20m79XWGGqAIkWnD2e0AGCK6QjjsldIfiByyRYzEvj06xGh5VzEfQVpN\nwkhA\r\n=XLq8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF5j0vWeGJbTk17EYLXYiEPQDmIlqivCT/L33fAZbapbAiB9WlvfKTFYIkEc8vSPOlb6+nyfrRVgXskjaE3kDW29kw=="}]},"_npmUser":{"name":"gkatsev","email":"me@gkatsev.com"},"directories":{},"maintainers":[{"name":"okaramian","email":"okaramia@gmail.com"},{"name":"gkatsev","email":"me@gkatsev.com"},{"name":"forbesjo","email":"joseph.a.forbes@gmail.com"},{"name":"gesinger","email":"gesinger@gmail.com"},{"name":"mjneil","email":"mneilweb@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webwackify_0.1.7_1638290772718_0.4669512181106381"},"_hasShrinkwrap":false}},"readme":"# webwackify\n\nInspired heavily by [webworkify](https://github.com/browserify/webworkify) and [webworkify-webpack-dropin](https://github.com/Ambroos/webworkify-webpack-dropin)\n\nlaunch a web worker that can require() in the browser with browserify and webpack\n\n# example\n\nFirst, a `main.js` file will launch the `worker.js` and print its output:\n\n``` js\nvar resolveWorker = function() {\n  var result;\n\n  try {\n    result = require.resolve('./worker.js');\n  } catch (e) {}\n\n  return result;\n};\n\nvar work = require('webworkify');\n\nvar w = work(require('./worker.js'), resolveWorker());\nw.addEventListener('message', function (ev) {\n    console.log(ev.data);\n});\n\nw.postMessage(4); // send the worker a message\n```\n\nthen `worker.js` can `require()` modules of its own.\n\nNOTE: `resolveWorker()` is used because he module id of the worker is required to pass along with the worker when webpack is used to bundle the project. Webpack will resolve module ids at build time by replacing calls to `require.resolve`. Browserify does not do this however, and we have to resolve the module ids ourselves using the dependency graph provided by browserify, so the `try{}catch{}` is added to prevent runtime errors.\n\nThe worker function lives\ninside of the `module.exports`:\n\n``` js\nvar gamma = require('gamma');\n\nmodule.exports = function (self) {\n    self.addEventListener('message',function (ev){\n        var startNum = parseInt(ev.data); // ev.data=4 from main.js\n\n        setInterval(function () {\n            var r = startNum / Math.random() - 1;\n            self.postMessage([ startNum, r, gamma(r) ]);\n        }, 500);\n    });\n};\n```\n\nNow after [browserifying](http://browserify.org) this example, the console will\ncontain output from the worker:\n\n```\n[ 4, 0.09162078520553618, 10.421030346237066 ]\n[ 4, 2.026562457360466, 1.011522336481017 ]\n[ 4, 3.1853125018703716, 2.3887589540750214 ]\n[ 4, 5.6989969260510005, 72.40768854476167 ]\n[ 4, 8.679491643020487, 20427.19357947782 ]\n[ 4, 0.8528139834191428, 1.1098187157762498 ]\n[ 4, 8.068322137547542, 5785.928308309402 ]\n...\n```\n\n# methods\n\n``` js\nvar work = require('webworkify')\n```\n\n## var w = work(require(modulePath), moduleId)\n\nReturn a new\n[web worker](https://developer.mozilla.org/en-US/docs/Web/API/Worker)\nfrom the module at `modulePath`.\n\nThe file at `modulePath` should export its worker code in `module.exports` as a\nfunction that will be run with no arguments.\n\nNote that all the code outside of the `module.exports` function will be run in\nthe main thread too so don't put any computationally intensive code in that\npart. It is necessary for the main code to `require()` the worker code to fetch\nthe module reference and load `modulePath`'s dependency graph into the bundle\noutput.\n\n`moduleId` is required when bundling with webpack. You can get the `moduleId` by calling `require.resolve(modulePath)`. It is suggested to use a `resolveWorker()` function like in the above example to avoid runtime errors when bundled with browserify.\n\n``` js\nvar resolveWorker = function() {\n  var result;\n\n  try {\n    result = require.resolve(modulePath);\n  } catch (e) {}\n\n  return result;\n};\n```\n\n## Worker.objectURL\n\nThe worker `w` returned by `webworkify` has the property `objectURL` attached.\n`w.objectURL` refers to the Object URL that was used to pass the module's source\nto the worker, and can be cleaned up using `URL.revokeObjectURL()`.  (See [example](https://github.com/substack/webworkify/blob/master/example/main.js))\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install webwackify\n```\n\n# license\n\nMIT\n","maintainers":[{"name":"okaramian","email":"okaramia@gmail.com"},{"name":"gkatsev","email":"me@gkatsev.com"},{"name":"forbesjo","email":"joseph.a.forbes@gmail.com"},{"name":"gesinger","email":"gesinger@gmail.com"},{"name":"mjneil","email":"mneilweb@gmail.com"}],"time":{"modified":"2022-05-24T08:42:16.752Z","created":"2018-02-05T21:24:01.333Z","0.1.1":"2018-02-05T21:24:01.333Z","0.1.2":"2018-02-05T21:29:01.360Z","0.1.3":"2018-03-06T19:42:14.309Z","0.1.4":"2018-03-15T17:40:26.991Z","0.1.5":"2018-03-15T22:18:24.006Z","0.1.6":"2018-03-20T19:51:01.479Z","0.1.7":"2021-11-30T16:46:12.887Z"},"homepage":"https://github.com/videojs/webwackify#readme","repository":{"type":"git","url":"git+ssh://git@github.com/videojs/webwackify.git"},"author":{"name":"Matt Neil"},"bugs":{"url":"https://github.com/videojs/webwackify/issues"},"license":"MIT","readmeFilename":"readme.markdown"}