facebookarchive/emitter

Package installs various fetch libraries

Closed this issue · 1 comments

Steps to reproduce

  1. npm init
  2. npm install fbemitter
  3. See isomorphic-fetch, node-fetch, whatwg-fetch in the node_modules folder
    node_modules

This looks smelly to me. Why does the emitter needs fetch libraries?

zpao commented

This is the flattened dependency tree. fbemitter requires fbjs which requires isomorphic-fetch which requires node-fetch and whatwg-fetch.

ProTip: You can run npm ls in the future to determine what the dependency tree look like.

/p/t/emittertest ❯ npm ls
emittertest@1.0.0 /private/tmp/emittertest
└─┬ fbemitter@2.1.1
  └─┬ fbjs@0.8.17
    ├── core-js@1.2.7
    ├─┬ isomorphic-fetch@2.2.1
    │ ├─┬ node-fetch@1.7.3
    │ │ ├─┬ encoding@0.1.12
    │ │ │ └─┬ iconv-lite@0.4.23
    │ │ │   └── safer-buffer@2.1.2
    │ │ └── is-stream@1.1.0
    │ └── whatwg-fetch@2.0.4
    ├─┬ loose-envify@1.4.0
    │ └── js-tokens@4.0.0
    ├── object-assign@4.1.1
    ├─┬ promise@7.3.1
    │ └── asap@2.0.6
    ├── setimmediate@1.0.5
    └── ua-parser-js@0.7.18