0.1.0 • Published 4 years ago

deno-quokka v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@brandonkal/deno-quokka

This npm module provides basic Quokka.js support for executing Deno files. This helps speed up development of Deno libraries such as yaml-tag.ts. It does this by injecting a mock Deno global module into your instrumented TypeScript files.

It should be used in combination with babel-plugin-deno which rewrites imports to use the cache directory.

Deno Quokka example with std/yaml

How it is done

The 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. Compile 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.

License

© 2020 Brandon Kalinowski. All Rights Reserved. MIT.

0.1.0

4 years ago