0

What is the correct approach to create an URL from a file path string in Node.js?

new URL("/foo/bar.js")
TypeError [ERR_INVALID_URL]: Invalid URL
vaughan
  • 6,535
  • 6
  • 43
  • 61
  • may this help you https://stackoverflow.com/questions/20619488/how-to-convert-local-file-path-to-a-file-url-safely-in-node-js – Dinesh karthik Sep 16 '21 at 16:41

0 Answers0