Skip to content

Instantly share code, notes, and snippets.

@7cc
Created September 11, 2019 21:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 7cc/3eeea9a8eb37dbc03dc43b190bdde899 to your computer and use it in GitHub Desktop.
Save 7cc/3eeea9a8eb37dbc03dc43b190bdde899 to your computer and use it in GitHub Desktop.
js import from Gist
async function importFromGist(gistURL) {
var scriptText = await fetch(gistURL).then(res=> res.text())
var blob = new Blob([scriptText], {
type: "application/javascript"
})
var url = URL.createObjectURL(blob)
return await import(url)
}
@FelixLuciano
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment