0.0.6 ā€¢ Published 5 years ago

@cypherlab/esm-import v0.0.6

Weekly downloads
6
License
ISC
Repository
github
Last release
5 years ago

@cypherlab/esm-import

šŸ”§ ESM import utility

Usage

It's a utility that can import an ES file from different sources, with a fallback mechanism.
The main usage is by specifying your local/dev sources first, and fallback sources after.
Sources can be localhost or external, but always use http protocol.

You can specify a second argument to choose what is returned from the module.
By default it returns the default export, but you can pass either a string or a function (module) => module.myExportedKey.

<script async type="module">
  import esmImport from 'https://unpkg.com/@cypherlab/esm-import'

  const MyComponent = await esmImport([
      `http://localhost/dist/index.js`            // local import
    , 'https://unpkg.com/@cypherlab/react-table'  // external import
  ], m => m.default)
</script>
0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago