# Usage An easy solution to a common problem. Tested with Node.js LTS (16 at the time of the gist creation). ```javascript buildUrl('http://example.com', 'a', 'b', 'c').toString() // http://example.com/a/b/c ``` > Note that the function returns a [URL](https://nodejs.org/api/url.html) object, not a string. > This gist is mostly inspired by a post on [StackOverflow](https://stackoverflow.com/questions/16301503/can-i-use-requirepath-join-to-safely-concatenate-urls).