node-modules / agentkeepalive

Support keepalive http agent.
MIT License
579 stars 57 forks source link

Add support to ES6 modules for the default agent #75

Closed topicus closed 5 years ago

topicus commented 5 years ago

Because the exported HttpAgent is not exported under the default namespace the following code makes HttpAgent to be undefined

import HttpAgent, {HttpsAgent, HttpOptions, HttpsOptions} from "agentkeepalive";
console.log(HttpAgent) // undefinded
codecov[bot] commented 5 years ago

Codecov Report

Merging #75 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #75   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines         174    175    +1     
=====================================
+ Hits          174    175    +1
Impacted Files Coverage Δ
index.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 48e01a4...14ab9d6. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #75 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #75   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines         174    175    +1     
=====================================
+ Hits          174    175    +1
Impacted Files Coverage Δ
index.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 48e01a4...14ab9d6. Read the comment docs.

fengmk2 commented 5 years ago

nodejs is not support es6 module by default at the current moment, I don't know which is the way to let commonjs support es6 module.

topicus commented 5 years ago

Closing this because is not correct. I was using typescript and to enable module interoperability it should set this flag in the compiler tsc --esModuleInterop.