{"_id":"@brandonkal/deno-quokka","_rev":"2-8125ce286df5520954bd3cc7a454414e","name":"@brandonkal/deno-quokka","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@brandonkal/deno-quokka","version":"0.1.0","description":"A Quokka plugin for running Deno code. Injects Deno global.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["quokka","deno","babel"],"author":{"name":"Brandon Kalinowski"},"license":"MIT","_id":"@brandonkal/deno-quokka@0.1.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-cfRq07iDfG/RdtBTBi6CEZMQZ9csRt/XeFgyXG6dmAF0w3NvoWAhdCgwf7Lrur5ClzSottxTeyAo9mG1ygp5IA==","shasum":"6123955fbed3bed7352a9a5aaf3c45527b4134b3","tarball":"https://registry.npmjs.org/@brandonkal/deno-quokka/-/deno-quokka-0.1.0.tgz","fileCount":5,"unpackedSize":107806,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHuy9CRA9TVsSAnZWagAAws8P/0URtBQh8LuUQh8s6fne\nAuFW2Lzg1CykJKxGNTRQnC/ue4V3YU2A4BRNvAag7YuKo19SD4VXtFIvfcL8\nPB+T+IWtIy+1vKVJcIq2qTGAmzXI1Z+Mtky5zy1jbs07J3O2TpkQnO6DGSt2\nCWU1d6ENlebYz06wHmlTNnCU0aVxk0mHEnf+8wOO1u2ofFZ36gAunwjq61GY\nVEbSC6ttjFYxotFa3u3ey2l1/JjGP8zbJQYYHMqVrQO9B1FmDPd21ao0wW7i\n6VXOxqFxLjjfthRwcnqOB99DHH6vE8rXddtD5NB7Dy3srcSZTHl9NFag1vLE\n72nHjQqK+vR2cXOGM7Hhm2rjIp1MLLHxV8rf8UYNRhHAB5VA58ryb48xu4sQ\nKTOMalLtI4hSzmxl2D1I0AUq9zimEfBx/a3EoKEjKhjcoht4QtCkKhD0XTjk\nZ1Z5oQwmFk7ygBT6te3Ln2jqrqidTcd3OShCbWuoF/7WGu4bwmOlz0L9eMU8\nYKWArtNuwl4LmlvLfZOmpkdrQyXhhXdMzFHgR3PdUP0rB3WSG/ffCde0QzyD\np9pbiZRKJaGnsnOc7iU1hnyD+s8hD0/cLTBefJknNKXsJADVHQwrGD950yOU\nyv9tEMhrJpsnr4EyARIAU++Khc7cvKuji9I/4XF9g5UIUMGzjKnwU2Q/s1p4\nokkR\r\n=qM4Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFpA+CkLMOvma8SSvDZuQ3K7g5PLWzG8riSM23NdWYV9AiAIWM4e4rysO07R6RlpE8lvzSo5WPdb1ZYDkA6wzwKicw=="}]},"maintainers":[{"name":"brandonkal","email":"bwebservice@gmail.com"}],"_npmUser":{"name":"brandonkal","email":"bwebservice@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deno-quokka_0.1.0_1579084989182_0.10192313264340269"},"_hasShrinkwrap":false},"0.2.0":{"name":"@brandonkal/deno-quokka","version":"0.2.0","author":{"name":"Brandon Kalinowski"},"description":"A Quokka plugin for running Deno code. Injects Deno global.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"keywords":["quokka","deno","babel"],"repository":{"directory":"npm/@brandonkal/deno-quokka","type":"git","url":"git+https://github.com/brandonkal/deno-lib.git"},"license":"MIT","bugs":{"url":"https://github.com/brandonkal/deno-lib/issues"},"homepage":"https://github.com/brandonkal/deno-lib#readme","_id":"@brandonkal/deno-quokka@0.2.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-xC7sxBawVrTfPv2xbCSjjIHBA5eAhA3BhBTZJHkywJyrlXN9zhPaUenVguTwWjd0Oe69TWP6L/uoT1X/lngfOg==","shasum":"46e0e10df148c1b60f9f9b75d4dc09ca7ce627a2","tarball":"https://registry.npmjs.org/@brandonkal/deno-quokka/-/deno-quokka-0.2.0.tgz","fileCount":5,"unpackedSize":108165,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHv/fCRA9TVsSAnZWagAAo58P/RxNrAqJiDd52cEgZv4p\nN0zcB6uutSrulyHn7FNwesNt6Xje9kGU0RiKNJHBdVF+DoP4+6fYnWyehTo/\nmtPhFURraVhvdrRd0652qd2YoBfml9vs1t+fue6Vpt7Bsu1DmTjfQFXzNnIV\nBK75q4uGs9LDc06W0Zav+nZg8QBC9+YocOqhDMcw3OA6mowtYvdN1AYV9muE\nRqOqoqIWMfcgJVLUbd2OIOENzzdWgS0hNq70xymy/CF9ABD7MqigHmypsXtq\npVkQxDKgk8VHCT1Y5gSQy+ZHmv1FmRgvLmQRTo4WxqkG/yGz74IjncwAGaeG\nmnLQJwDH0klkaKLLmEVAZfA8mvPIApsVeTS2p3NW9mML3oXMQuol4erjnNSu\nJb/HnwLsUs75hWIcLSKcO0TyMD7DzOF2DQdWGb/c4dlAaykE6sksAkOEu+sG\nRMmElCv4AqsAPW3IfMRUsWKa2s4if2ExRl/SjHrATF1iAsd93MvkOVQyoKXf\n3ivGG35yWMdOYeCdQRixFt/w5KAggLfUlUt//a/4UwdQvL4AjZOx1gJimnB9\n5ScjgOpnZGY0DlUMk1IjmDvzlWnAzra0pWW//AOVlRomvEX2UQLL4wshW9i6\nRq6Qn8T7c6knYghmvfFdhbeHAzFEYgeLjU7KcgbVXmw2/6A7/QXLCmpxy5Zt\nAD09\r\n=hO4t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8YDdcfvGQOIPAT7E9B2sI+cfcZksSRF9agECbP4YnMAiEA5VDD98RKKoHWurxwfJDVchCEhR3GEAXMGSxaqBdu+yw="}]},"maintainers":[{"name":"brandonkal","email":"bwebservice@gmail.com"}],"_npmUser":{"name":"brandonkal","email":"bwebservice@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/deno-quokka_0.2.0_1579089887046_0.9908412495337906"},"_hasShrinkwrap":false}},"time":{"created":"2020-01-15T10:43:09.149Z","0.1.0":"2020-01-15T10:43:09.292Z","modified":"2022-04-04T20:25:16.723Z","0.2.0":"2020-01-15T12:04:47.196Z"},"maintainers":[{"name":"brandonkal","email":"bwebservice@gmail.com"}],"description":"A Quokka plugin for running Deno code. Injects Deno global.","keywords":["quokka","deno","babel"],"author":{"name":"Brandon Kalinowski"},"license":"MIT","readme":"# @brandonkal/deno-quokka\n\nThis npm module provides basic Quokka.js support for executing Deno files. This helps speed up development of Deno libraries such as `yaml-tag.ts`.\nIt does this by injecting a mock Deno global module into your instrumented TypeScript files.\n\nIt should be used in combination with `babel-plugin-deno` which rewrites imports to use the cache directory.\n\n![Deno Quokka example with std/yaml](https://user-images.githubusercontent.com/4714862/72419175-2f72ad00-3774-11ea-950a-a20936b7fb95.png)\n\n## Config\n\nInstall Dependencies. We replace TypeScript compiler with Babel to strip types and rewrite imports:\n```sh\nnpm i @babel/core babel-plugin-deno @brandonkal/deno-quokka @babel/plugin-syntax-import-meta @babel/plugin-syntax-top-level-await @babel/plugin-transform-typescript @babel/preset-env @babel/register @babel/cli\n```\n\nIn your `~/.quokka/config.json file:\n```json\n{\n  \"pro\": true,\n  \"babel\": {\n    \"ts\": true,\n    \"presets\": [[\"@babel/preset-env\", { \"targets\": { \"node\": \"current\" } }]],\n    \"plugins\": [\n      \"deno\",\n      \"@babel/plugin-syntax-import-meta\",\n      \"@babel/plugin-syntax-top-level-await\",\n      [\"@babel/plugin-transform-typescript\", { \"allowNamespaces\": true }]\n    ]\n  },\n  \"plugins\": [\"@brandonkal/deno-quokka\"]\n}\n```\n\n## Caveats\n\n- import.meta does not function because node still does not support ESM completely.\n- Top Level await is not available. Just wrap everything in an `async function main()`\n\n## How it is done\n\nThe work here is rather simple. Run `deno types > src/deno-bridge.ts`. Then remove all code not in the Deno namespace and flatten the file. Change `export let` to `export const` and manually add implementations for each function.\nCompile with `npx tsc src/deno-bridge.ts`. This should be enough to keep the Deno compiler from complaining. If your imported code actually makes extensive use of the Deno API, then please contribute a more robust polyfill here.\n\n## License\n\n© 2020 Brandon Kalinowski. All Rights Reserved. MIT.","readmeFilename":"README.md","homepage":"https://github.com/brandonkal/deno-lib#readme","repository":{"directory":"npm/@brandonkal/deno-quokka","type":"git","url":"git+https://github.com/brandonkal/deno-lib.git"},"bugs":{"url":"https://github.com/brandonkal/deno-lib/issues"}}