sindresorhus / normalize-url

Normalize a URL
MIT License
837 stars 123 forks source link

Add `url` as optional dependency? #83

Closed dzek69 closed 5 years ago

dzek69 commented 5 years ago

This library depends on url on some environments, but it's not listed as optional dependency. IMO it should list it.

Why libraries should state optional dependencies? 1) to avoid confusion when trying to use the library 2) so user will know the correct dependency version library works with

Please add it

sindresorhus commented 5 years ago

The url module is a core Node.js module and should not be listed in package.json at all.

sindresorhus commented 5 years ago

https://nodejs.org/api/url.html

dzek69 commented 5 years ago

This assumes you only want your package to be used in Node environment. I'm using it with React Native and could want to use it on web with older browsers. But on the other hand - having this installed on Node environment is a waste.

I guess the current behavior is the most right one then.