From 02ce33901ae8a0682db38f6a09add0e2dde0f825 Mon Sep 17 00:00:00 2001 From: Ayo Reis <84969551+ayoreis@users.noreply.github.com> Date: Tue, 9 Aug 2022 15:32:56 +0100 Subject: [PATCH] docs: Upgrade --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc5d542..0bb46dc 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,21 @@ -# dynamic-import-ponyfill +# 🐎 Dynamic import ponyfill! A [ponyfill](https://github.com/sindresorhus/ponyfill) for using dynamic imports within [Deno Deploy](https://deno.com/deploy). ```ts -import { importModule } from 'https://deno.land/x/dynamic_import_ponyfill@v0.1.2/mod.ts' +import { importModule, } from 'https://deno.land/x/dynamic_import_ponyfill@v0.1.3/mod.ts' if (Math.random() > 0.5) { await importModule('./foo.ts') } else { await importModule('./bar.ts') } +``` + +This module also exports an awesome function which evaluates code from a string containing `import` and `exports` statements 🎉. + +```tsx +import { importString, } from 'https://deno.land/x/dynamic_import_ponyfill@v0.1.3/mod.ts' + +console.log(await importString('export const foo = "bar"')) ``` \ No newline at end of file