Isomorphic npm package dependencies

215 Views Asked by At

I want to build isomorphic npm package that will be used both by my angular application in browser and by console node.js tool. The package perform some http requests for which I use fetch API. I usually add isomorphic-fetch and es6-promise pollyfill to project dependencies to have the same fetch method in browser and node. That packages add Promise object and fetch functions globally if they does not exists.

But in case of shared package that could be used by someone else - is it a good idea to add such dependencies? Other people could already use different Promise or fetch implementation (e.g. 'promise' package for node). Isn't it better to warn people in README that my package rely on Promise object and fetch method and let them choose prefered implementation?

0

There are 0 best solutions below