jednano / iso-http

An HTTP request library that enables isomorphic applications.
MIT License
10 stars 3 forks source link

please add browserify property to package.json to make compatible to load with browserify #1

Closed jeffbski closed 9 years ago

jeffbski commented 9 years ago

Could you please add the browserify property to package.json to make it compatible to load with browserify?

When using browserify, one shouldn't have to do anything special to use the component in the browser other than install with npm.

To make this package compatible with browserify, I believe that you would simply add a browserify option to your package.json, specifying what to load for the browser (if it is different than for the server).

Since the current package.json only specifies main which is pointing to the node.js version, browserify tries to load that in the browser and it fails when making a request. Once you add the browserify property to package.json, you can have it load the appropriate browser version instead.

https://github.com/substack/node-browserify#packagejson

Thanks.

jednano commented 9 years ago

Fixed in https://github.com/jedmao/iso-http/commit/17c81e6a192c033e128bf3baf01b82ba20d964c0. Thanks for the suggestion!

jeffbski commented 9 years ago

Excellent, thanks!

jeffbski commented 9 years ago

Works great, thanks for the quick update.

jednano commented 9 years ago

Great. Let me know if you have any issues.