1

How can I include CDN library in a nodejs file? I have to include <script src="https://cdn.auth0.com/js/lock/10.23.1/lock.min.js"></script> in a nodejs file and can't do npm install auth0-lock instead. How can I insert this tag in nodejs file to work properly?

we.are
  • 409
  • 2
  • 6
  • 15
  • Your question is similar to this post, please check here: https://stackoverflow.com/questions/7809397/how-to-require-from-url-in-node-js – surreal_sai May 03 '18 at 18:08
  • Also look at [Loading remote js file using require with node.js](https://stackoverflow.com/questions/23566310/loading-remote-js-file-using-require-with-node-js). – Andrew Myers May 03 '18 at 18:08
  • Possible duplicate of [how to require from URL in Node.js](https://stackoverflow.com/questions/7809397/how-to-require-from-url-in-node-js) – Andrew Myers May 03 '18 at 18:10
  • This has been answered in another post https://stackoverflow.com/questions/31240680/how-to-import-javascript-library-from-cdn-links-in-a-node-js-script – Muhammad Ali Rashed Dec 22 '20 at 11:06

0 Answers0