{"_id":"11ty-fast-dev","_rev":"2-7c29d69637255fb901e89397b1cfde2a","name":"11ty-fast-dev","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"11ty-fast-dev","version":"0.1.0","description":"11ty-fast-dev","main":"index.js","repository":{"type":"git","url":"git+https://github.com/samthor/11ty-fast-dev.git"},"author":{"name":"Sam Thorogood","email":"sam.thorogood@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/samthor/11ty-fast-dev/issues"},"homepage":"https://github.com/samthor/11ty-fast-dev#readme","dependencies":{"node-fetch":"^2.6.1"},"gitHead":"58b1b153ae88bb0ba4e0cfd78e4a81ff6b192599","_id":"11ty-fast-dev@0.1.0","_nodeVersion":"15.2.0","_npmVersion":"7.0.10","dist":{"integrity":"sha512-zoHAT7tTWmh/qJxh7bWWhplQFWVbqCFrrldFLcUiCssAYaJmO9cFWLpxe1jy36DYOvXS51pshsFohqAerQTE9g==","shasum":"ae8a3f58a3abadf57655e43ae3a5bbd816151ff4","tarball":"https://registry.npmjs.org/11ty-fast-dev/-/11ty-fast-dev-0.1.0.tgz","fileCount":7,"unpackedSize":22128,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0v+bCRA9TVsSAnZWagAAb6cP/iruwXZsIy8EQpMxR2Ne\nkM9iNvymKHHMKkEbFx6OMDnBCWrBGenWGcGGHOyxDOpYm+86UcEe1ixXmolD\nQMTm3btU9jvN6LbqSxzI7UPTm28gi+SnqaLjjqN2DUJsvF/RcH1+8VsaYxxP\nxBMTKfld4gWR/MQ1qkgssTauE4qbXPPaKPHcq8qiLS4K2vS4ElgAFyzepCKQ\nVo9ZOIY+6J87zsBRThyR3BzCnpdopXpIMmYm6S+DrA7fQAoVQf8MewllA8XD\n8gMgzB1xZ34bEYaLv+z1fVw+SgQba/lpMOasgs+Q+FST1d2EcGVxyjOC5zQd\nxUn6UVGfTgwxy8Qovt/2eh0R2jWnMN5RQcRlAdq1c/PK/JGLyYJH3goKtwAi\nIBtcd2+lUul/fAJN4Q6byJ2YnwhbBAEdrZgGD28wCKfg87sNCL9Cg9yQH4nF\n0YJLLrMnnySdy2s4vUK/qeR2FPg8kIlLUJPtocp2Aia1tikyXMJs5LbY+uW0\nc8jNdcALe31D3seDOGjCrE3hrgSmncyk+tMNjxyZoJ7r+w3lFqE6bJyfcI90\n87kmj9JNZkney7mXvNVzLVKerWHltEfou+Vr8a1XF8QolqmM4fu9YtkmYtL3\nFusyGGQ9qflTF9illwO2lY5Y/l05d1vbVaO1ZpxLeNhr1CYFTDpoCaF9g/iJ\nrOJ6\r\n=Z+I5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDOyZlRgaTcfppMkjqd783CK1Hp/9yzthF75S/Sew7QGQIgZ5gyeyHJ3A2EXg8aycgIbrPCxhJAkG/iuYbZNqHCEvs="}]},"_npmUser":{"name":"samthor","email":"sam.thorogood@gmail.com"},"directories":{},"maintainers":[{"name":"samthor","email":"sam.thorogood@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/11ty-fast-dev_0.1.0_1607663514987_0.3499696252912994"},"_hasShrinkwrap":false},"0.1.1":{"name":"11ty-fast-dev","version":"0.1.1","description":"11ty-fast-dev","main":"index.js","repository":{"type":"git","url":"git+https://github.com/samthor/11ty-fast-dev.git"},"author":{"name":"Sam Thorogood","email":"sam.thorogood@gmail.com"},"license":"Apache-2.0","bugs":{"url":"https://github.com/samthor/11ty-fast-dev/issues"},"homepage":"https://github.com/samthor/11ty-fast-dev#readme","dependencies":{"node-fetch":"^2.6.1"},"gitHead":"a986730ff4f160fbe8299f4f79e8a71eb74ac56a","_id":"11ty-fast-dev@0.1.1","_nodeVersion":"15.2.0","_npmVersion":"7.0.10","dist":{"integrity":"sha512-cZxs+d7N4C1PeFLO1bmmMr2VTIUEYo8pxBdiGhUxOXv2fEH8z7a4FEsuakxjX3ONfzNEh9juHSrB+HyXUCkIQw==","shasum":"39506e28a7cf646701b3940ff15186aa9d4e6921","tarball":"https://registry.npmjs.org/11ty-fast-dev/-/11ty-fast-dev-0.1.1.tgz","fileCount":7,"unpackedSize":22125,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0v/4CRA9TVsSAnZWagAA2BgP+wRCsZNP2TdnEBDCX/W9\nXXPWYO5bP8iSU8wSxTdgZI0d95z6i9Ssx2JkA7i2qevE3Rk5i+RC/wi85p74\nPXmXNVhcgkjrYGxAXpMtPcYBeWoLFaonRmant9O3e6NaFWxvWv9nlOeK/mAr\n3TmYEMCwwHAL28NIYx59gbUOLexCzJu2+2khaAZVnYcNpzcHdNOJdYcQ9TDp\n9yPt630G8iv2tJyvCCN8gWWn3+cNpGPpJ37RSPO85D7HAIgClBkpS54S0Kdd\nrrF+9DFsRx2P/FSWdUX8m5eprKFBCaeOnaUPPTGi+VJJuCaTrJoNDwEswKOK\nYeYoT6mBVxR8Ip8/GLuApsv4Uf/GiD1LlmoakV6a7VNA0vBtXdu1rx4yJ4cz\nR2kehteljaojA1vUqJNzYuigl5s5YQboPmRKwtnQdwWpFaIZQZlG/D0rFCfy\nM/pbPK/ncEUral4KVghEdxtUNLJJGL8CEPkLoRbRZqo9dj2fakeX20oukfgg\nL2kXPLExoQNUVnrdZ+19r+mig4QuuuQQEY7h07arVoWWUcpTU4lr/2tbXToZ\nRBRC5fu/M573ONnR7rE74oWRUcS3NQeWc2D/AX0M2kIEMCiqEXF4/2Awkxzx\nOvmzVGb3fS3vt+prIORBsSaV3QRIcwI0ynO8cA1N3MIeNRgKpIc+xY3QE3/r\ntGDQ\r\n=bgg1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHTsuHGU63bptzWon6lWF0ObHxy9wTkO0sq8WALvaEvAiEAok90n6A7ZzEIHvQ5BsLecGdSgLJcgWpLwBJP5B1AsLE="}]},"_npmUser":{"name":"samthor","email":"sam.thorogood@gmail.com"},"directories":{},"maintainers":[{"name":"samthor","email":"sam.thorogood@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/11ty-fast-dev_0.1.1_1607663607826_0.41458749587516874"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-11T05:11:54.987Z","0.1.0":"2020-12-11T05:11:55.135Z","modified":"2022-04-04T10:10:34.709Z","0.1.1":"2020-12-11T05:13:27.944Z"},"maintainers":[{"name":"samthor","email":"sam.thorogood@gmail.com"}],"description":"11ty-fast-dev","homepage":"https://github.com/samthor/11ty-fast-dev#readme","repository":{"type":"git","url":"git+https://github.com/samthor/11ty-fast-dev.git"},"author":{"name":"Sam Thorogood","email":"sam.thorogood@gmail.com"},"bugs":{"url":"https://github.com/samthor/11ty-fast-dev/issues"},"license":"Apache-2.0","readme":"This makes 11ty more efficient when used behind a dev server, making it only compiles your pages when you actually want to see them.\n\nThis relies on you running your own dev server.\n(This could be built into `eleventy --serve`, I don't know.)\n\n⚠️ This is a crazy idea and perhaps not intended for production use just yet.\nYou're welcome!\n\n## Usage\n\nYour .eleventy.js should be updated like this:\n\n**TODO(samthor): This should be flagged or only run in `--watch` mode.**\n\n```js\nconst eleventyFastDev = require('11ty-fast-dev/patch');\n\nmodule.exports = eleventyConfig => {\n  // We can't set up 11ty-fast-dev here, but instead need to do it later in\n  // 11ty's lifecycle. Its calculation of collections is a great place, as this\n  // is before any files are written.\n  // TODO(samthor): We only want to do this when flagged or in watch mode and\n  // so on.\n  const config = eleventyFastDev.buildConfig(eleventyConfig);\n  eleventyConfig.addCollection('_11ty-fast-dev', config);\n\n  // ... the rest of your config\n};\n```\n\nAdd this handler to your web server (this uses Express):\n\n```js\nconst {buildEleventyFastDevHandler} = require('11ty-fast-dev/handler');\n\nconst staticPaths = ['dist'];  // 11ty writes here by default\nconst eleventyFastDevHandler = buildEleventyFastDevHandler(staticPaths);\n\n// Insert this _before_ your static handlers, so old dist files don't \"win\".\napp.use(eleventyFastDevHandler);\n```\n\nProfit!\n\n## Implementation\n\nThe eleventy side does two things:\n\n* monkeypatches `TemplateWriter._writeTemplate` so that instead of writing a template, we store this ability into a closure\n* opens a web server on \"localhost:9999\", and when the right page is requested, renders the file\n\nOn the server side, it's a pretty basic handler which then goes out and asks \"localhost:9999\" for the right page.\n\n## Downsides\n\nThis will, as stated, only execute your templates and run transforms when you request a file.\nIf you have side effects in these places, then this won't work for you.\n(This is generally considered a bad idea _anyway_).\n","readmeFilename":"README.md"}