bendrucker/random-url ? reverse-engineered prompt

Reverse engineered prompt

Build me a small JavaScript package that generates a random URL.

I want it to be simple to use, so if I call it with no arguments it should give me a random http URL, and if I pass a protocol like https it should make a random URL with that protocol instead. Keep the API tiny and easy to require from Node.

Please include a few tests so I can trust that it works, especially for the default behavior and for a custom protocol. Make the package feel like a normal npm library I could publish and install with npm install. If you need to look up current docs or best practices for random URL generation, go ahead and check online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab