How to directly import an NPM module in Codepen (using unpkg)

NOTE: If you’re using this for your OWN package, please make sure you’re precompiling your NPM modules to a bundle first! Otherwise this won’t work.

Step 1: Create a pen

Step 2: Go to Settings -> JS

Step 3: Add an unpkg link as an external script with the following URL pattern: https://unpkg.com/<package-name>, then click “Save & Close”

Step 4: There is no step 4. You are DONE!

CEO & Sr. Software Developer at Mintbean. Advocate for newer & job-seeking software engineers. Come join our Discord: https://discord.gg/j7CjBAz