Created
March 18, 2021 16:56
-
-
Save kellenmace/b9d34dc4eb569e75644391851fef5ad3 to your computer and use it in GitHub Desktop.
Dynamically import an NPM module from dev.jspm.io to try it out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dynamically import an NPM module from dev.jspm.io to try it out. | |
// Run this in your browser console. | |
(async function() { | |
const axios = (await import('https://dev.jspm.io/axios')).default; | |
const response = await axios.get('https://pokeapi.co/api/v2/pokemon/'); | |
console.log(response.data); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note:
This code won't work on this GitHub Gist page, since cross-origin requests violate their content security policy. 🤓
Try it somewhere else, like https://kellenmace.com, https://www.google.com, etc.