Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
docs: Upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
ayoreis committed Aug 9, 2022
1 parent d46d083 commit 02ce339
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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"'))
```

0 comments on commit 02ce339

Please sign in to comment.