{"_id":"elm-hot","_rev":"2738054","name":"elm-hot","description":"Hot code swapping for Elm","dist-tags":{"latest":"1.1.6"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"time":{"modified":"2022-01-28T15:50:52.000Z","created":"2018-08-26T04:36:57.327Z","1.1.6":"2021-01-27T19:12:45.127Z","1.1.5":"2020-07-21T20:17:32.244Z","1.1.4":"2019-11-20T16:24:26.019Z","1.1.3":"2019-11-04T16:25:38.896Z","1.1.2":"2019-08-13T15:52:26.988Z","1.1.1":"2019-08-02T18:46:42.524Z","1.1.0":"2019-06-05T20:39:03.469Z","1.0.1":"2018-09-22T17:38:07.352Z","1.0.0":"2018-09-07T17:48:44.831Z","0.9.1":"2018-08-26T04:36:57.327Z"},"users":{},"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"versions":{"1.1.6":{"name":"elm-hot","version":"1.1.6","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"./test.sh"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"^3.15.0","chokidar":"^3.5.1","express":"^4.17.1","puppeteer":"^5.5.0","tap-xunit":"^2.4.1"},"gitHead":"f31865e80716087f6e2154872138cd81faf05a65","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.6","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"shasum":"93e3962b40670e65f0a3640951b3add2702bfd0e","size":117108,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.6.tgz"},"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.6_1611774764959_0.36094909719131163"},"_hasShrinkwrap":false,"publish_time":1611774765127,"_cnpm_publish_time":1611774765127},"1.1.5":{"name":"elm-hot","version":"1.1.5","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"./test.sh"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"^3.10.1","chokidar":"^3.4.1","express":"^4.17.1","puppeteer":"^5.2.1","tap-xunit":"^2.4.1"},"gitHead":"efe9db967496415944246006b4e711c0aed1e777","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.5","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"shasum":"bba309b592d39b5c3195c3c6f608f36b96c23b89","size":116999,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.5.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.5_1595362652063_0.9499061420335269"},"_hasShrinkwrap":false,"publish_time":1595362652244,"_cnpm_publish_time":1595362652244},"1.1.4":{"name":"elm-hot","version":"1.1.4","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"^2.2.0","chokidar":"^3.0.2","elm":"^0.19.0","express":"^4.17.1","puppeteer":"^1.19.0","tap-xunit":"^2.4.1"},"gitHead":"95730c11963a198ed362b5fabd5a0ad1ae2f5000","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.4","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","dist":{"shasum":"4984592b3554670255ea4e08f4e98aa9103ab51f","size":38635,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.4.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.4_1574267065841_0.3477673056114148"},"_hasShrinkwrap":false,"publish_time":1574267066019,"_cnpm_publish_time":1574267066019},"1.1.3":{"name":"elm-hot","version":"1.1.3","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"^2.2.0","chokidar":"^3.0.2","elm":"^0.19.0","express":"^4.17.1","puppeteer":"^1.19.0","tap-xunit":"^2.4.1"},"gitHead":"6606cd3f74c3814b2d2911fdd39414a0e6dc7f47","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.3","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","dist":{"shasum":"8f921ad44afc969933847376262f209e6330b3e2","size":36002,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.3.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.3_1572884738727_0.40036633173998526"},"_hasShrinkwrap":false,"publish_time":1572884738896,"_cnpm_publish_time":1572884738896},"1.1.2":{"name":"elm-hot","version":"1.1.2","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"^2.2.0","chokidar":"^3.0.2","elm":"^0.19.0","express":"^4.17.1","puppeteer":"^1.19.0","tap-xunit":"^2.4.1"},"gitHead":"e3eb5d1513475f12e8bc2d1a54774cb0a49c03de","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.2","_nodeVersion":"12.8.0","_npmVersion":"6.10.3","dist":{"shasum":"306da61ba97c12518957bacb87473f364b0e2509","size":221352,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.2.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.2_1565711546793_0.9885864990479796"},"_hasShrinkwrap":false,"publish_time":1565711546988,"_cnpm_publish_time":1565711546988},"1.1.1":{"name":"elm-hot","version":"1.1.1","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"1.0.0-beta.6","chokidar":"^2.0.4","elm":"^0.19.0","express":"^4.16.3","puppeteer":"^1.17.0","tap-xunit":"^2.3.0"},"gitHead":"53ad807374be2df9387d874a953552d5f83321a2","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.1","_nodeVersion":"12.5.0","_npmVersion":"6.9.0","dist":{"shasum":"5284dcb475b329b1a41f1b41d201041cd05a3b96","size":225903,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.1.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.1_1564771602279_0.9718859151644033"},"_hasShrinkwrap":false,"publish_time":1564771602524,"_cnpm_publish_time":1564771602524},"1.1.0":{"name":"elm-hot","version":"1.1.0","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"1.0.0-beta.6","chokidar":"^2.0.4","elm":"^0.19.0","express":"^4.16.3","puppeteer":"^1.17.0","tap-xunit":"^2.3.0"},"gitHead":"e61deeef463e7c9f0be66e71985d4ab3d56e8591","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.1.0","_nodeVersion":"11.10.0","_npmVersion":"6.7.0","dist":{"shasum":"6daaf4a3f0bb8fd19306337ba887b7f7c8e5936e","size":39591,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.1.0.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.1.0_1559767143331_0.17896115869096785"},"_hasShrinkwrap":false,"publish_time":1559767143469,"_cnpm_publish_time":1559767143469},"1.0.1":{"name":"elm-hot","version":"1.0.1","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"1.0.0-beta.6","chokidar":"^2.0.4","elm":"^0.19.0","express":"^4.16.3","puppeteer":"^1.5.0","tap-xunit":"^2.3.0"},"gitHead":"50af688449ab45d674fc0ef1388079ba27547b64","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"dist":{"shasum":"12751fc41ecf1ddc58b5492114d6f77395d3a440","size":40662,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.0.1.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.0.1_1537637887164_0.8276033451382041"},"_hasShrinkwrap":false,"publish_time":1537637887352,"_cnpm_publish_time":1537637887352},"1.0.0":{"name":"elm-hot","version":"1.0.0","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"1.0.0-beta.6","chokidar":"^2.0.4","elm":"^0.19.0","express":"^4.16.3","puppeteer":"^1.5.0","tap-xunit":"^2.3.0"},"gitHead":"d4bd8be7d266db2fa5ffa145f32c1f3d444b730a","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"dist":{"shasum":"d2087f896545915029919dcdbcb4b8fdc08aec96","size":39595,"noattachment":false,"key":"/elm-hot/-/elm-hot-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-1.0.0.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_1.0.0_1536342524609_0.38229741900730674"},"_hasShrinkwrap":false,"publish_time":1536342524831,"_cnpm_publish_time":1536342524831},"0.9.1":{"name":"elm-hot","version":"0.9.1","description":"Hot code swapping for Elm","keywords":["Elm","HMR","hot","reload"],"author":{"name":"Keith Lazuka"},"repository":{"type":"git","url":"git+https://github.com/klazuka/elm-hot.git"},"license":"MIT","main":"src/index.js","scripts":{"test":"ava"},"ava":{"files":["test/test.js"]},"devDependencies":{"ava":"1.0.0-beta.6","chokidar":"^2.0.4","elm":"^0.19.0","express":"^4.16.3","puppeteer":"^1.5.0","tap-xunit":"^2.3.0"},"gitHead":"5e2619930f44b7c5b28baee00c2dc16e04a40cf1","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"homepage":"https://github.com/klazuka/elm-hot#readme","_id":"elm-hot@0.9.1","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"klazuka","email":"klazuka@gmail.com"},"dist":{"shasum":"b8f652b0a6cb93bb0d7c4bcabb639aa3088c253b","size":33926,"noattachment":false,"key":"/elm-hot/-/elm-hot-0.9.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/elm-hot/download/elm-hot-0.9.1.tgz"},"maintainers":[{"name":"klazuka","email":"klazuka@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/elm-hot_0.9.1_1535258217201_0.4920844115035423"},"_hasShrinkwrap":false,"publish_time":1535258217327,"_cnpm_publish_time":1535258217327}},"readme":"![elm-hot](https://github.com/klazuka/elm-hot/workflows/elm-hot/badge.svg)\n\n# elm-hot\n\nThis package provides the core infrastructure needed for doing hot code swapping in Elm. It supports Elm 0.19 only.\n\n**This low-level package is intended for authors of Elm application servers.**\n\nIf you're looking for something that's easier to use, and you're willing to use Webpack, see [elm-hot-webpack-loader](https://github.com/klazuka/elm-hot-webpack-loader), which is built using this package. Another option is Parcel which has [built-in support for Elm](https://parceljs.org/elm.html) and this package.\n\nThe goal of this package is to provide a reusable core that can be used to provide hot code swapping support in a variety of environments--not just Webpack.\n\n\n## Changelog\n\n### 1.1.6\n- more lenient search for Browser.Navigation.Key in the generated JS\n- updated dependencies\n\n### 1.1.5\n- update dependencies\n\n### 1.1.4\n- fixed a bug where HMR failed because `Browser.Navigation.Key` changed location\n- fixed a crash when the app's `Model` contains `Json.Encode.null`\n\n### 1.1.3\n- fixed a crash when using Elm debugger and elm/browser 1.0.2\n\n### 1.1.2\n- fixed a bug where HMR would not work for very small (\"toy\") Elm projects\n\n### 1.1.1\n- added support for Elm 0.19.1\n\n### 1.0.1\n- bug fixes\n\n### 1.0.0\n- improved Browser.application support (Browser.Navigation.Key can be stored anywhere in your model now) \n\n### 0.9.1\n- separated the Webpack loader out into its own package\n- exposed core API\n\n### 0.9.0\n- first release\n\n\n### Installing `elm-hot` core API\n\n```bash\n$ npm install --save elm-hot\n```\n\n---------------------------------------------\n\n### Core API\n\n\n**`function inject(str)`**\n\nInjects the hot code swapping functionality into a compiled Elm app.\n\n- takes the Javascript code emitted by the Elm compiler as an input string\n- returns a string containing the injected code ready to be `eval`-ed in the browser.   \n\n\n### Example of how the core API could be used \n\n```javascript\nconst elmHot = require('elm-hot');\nconst {compileToStringSync} = require('node-elm-compiler');\nconst injectedCode = elmHot.inject(compileToStringSync([\"src/Main.elm\"], {}));\n```\n\nIn order to provide something similar to `webpack-dev-server` with hot module reloading, an application server could be developed to do the following:\n\n- serve a modified version of the app developer's `index.html` to receive push events from the server\n- watch `.elm` files on disk for changes\n- whenever a source file changes, push an event to the client notifying it that it should fetch new code from the server\n- when the client receives the event:\n    - fetch the new code (the server will re-compile the Elm code and use `elm-hot` to inject the hot-code-swapping logic)\n    - the client deletes the old `Elm` object and calls `eval()` on the new code from the server\n    \nI have implemented something similar to this for the integration tests. See [test/server.js]() and [test/client.js]() for inspiration.\n\nThe above description is probably a bit too vague, so if you would like more details, create an issue.\n\n-------------------------------------------\n\n\n### Attribution\n\nElm hot code swapping is based on the work of Flux Xu's [elm-hot-loader](https://github.com/fluxxu/elm-hot-loader).\n","_attachments":{},"homepage":"https://github.com/klazuka/elm-hot#readme","bugs":{"url":"https://github.com/klazuka/elm-hot/issues"},"license":"MIT"}