feross / simple-get

Simplest way to make http get requests. Supports HTTPS, redirects, gzip/deflate, streams in < 100 lines
MIT License
401 stars 50 forks source link

restore compatibility with node 6 in version 3.x.x #39

Closed mcollina closed 6 years ago

mcollina commented 6 years ago

Node 6.0 is still supported for another year, and it would be fantastic to see it being kept supported in simple-get.

I think the only problem is related to the use of the spread operator, so maybe we can remove that.

https://travis-ci.org/fastify/fastify-cli/jobs/370790022#L1283-L1303

/home/travis/build/fastify/fastify-cli/node_modules/simple-get/index.js:14
  opts = typeof opts === 'string' ? { url: opts } : { ...opts }
                                                      ^^^
SyntaxError: Unexpected token ...
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/travis/build/fastify/fastify-cli/test/start.js:8:35)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.runMain (module.js:611:10)

If you do not have bandwidth, I'll be happy to help out with maintenance. This is my go-to http client.

(This means we cannot upgrade to simple-get@3.0.0 in fastify tests.)

feross commented 6 years ago

Removed the spread operator in https://github.com/feross/simple-get/commit/38ddd5bed1e8744fd6077909a4e8fdb0bf644870. Will release a patch once tests pass

feross commented 6 years ago

Also needed to remove Object.entries() https://github.com/feross/simple-get/commit/4459575e4a5f4fab2053a3441e4522dcab4f6b7d

feross commented 6 years ago

Released 3.0.1

mcollina commented 6 years ago

Thank you very much!