import-dynamic
v0.0.2
Published
Dynamic import module from url
Downloads
1
Maintainers
Readme
Import Dynamic
Dynamic import module from url.
Installation
npm install import-dynamic
Usage
import importDynamic from 'import-dynamic'
const fn = await importDynamic('https://url-of-module', {
fetchOptions: { // fetch options
method: 'GET',
},
globals: { // global values
globalValue: 1,
},
})
fn()
- fetchOptions: An object containing any custom settings that you want to apply to the request. MDN Link
- globals: An object containing global values.