I would like to use valid-url to validate some URLs using JSFiddle so that I can share it later. I tried adding a link to the index.js
file from Github (https://raw.githubusercontent.com/ogt/valid-url/master/index.js) but Fiddle says:
Github is not a CDN, using it as such will cause issues with loading the file. Do you still with to it?
And obviously when I try to use it, an error is thrown:
Refused to execute script from [...] because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
So, is there any way to use npm packages in a JSFiddle? Or any workaround to achieve this?
Use unpkg.com. They allow you to load any npm module from the browser like a CDN.