Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with node 0.4.x #1

Closed
tvishwanadha opened this issue Jan 17, 2012 · 3 comments
Closed

Incompatible with node 0.4.x #1

tvishwanadha opened this issue Jan 17, 2012 · 3 comments

Comments

@tvishwanadha
Copy link

Love the simplicity of needle, but it looks like needle doesn't really support 0.4.x. Since I'm hosting on heroku, I'm stuck with node 0.4.7.

The main issues are:

  • commit 36c797f1 requires a json file. node 0.4.12 can only import js files as modules. JSON import came with node 0.6.x. Not sure how to fix this short of just harcoding the version number and bumping it with each release.
  • commit d12105dd depends on the zlib module, which was also added in node 0.6.0. node-zlib exists and conflicts with the new 0.6.x module, but a better option might try/catching zlib and just saying zlib is only supported for 0.6.x.
  • commit 8642c3de doesn't quite fix paths for older node, since it drops the query string. As shown in the 0.6.x docs, path = pathname + search

I'll fork and submit a pull request for the latter two, but I'm not sure about the best course of action to fix the first issue.

@tomas
Copy link
Owner

tomas commented Jan 17, 2012

Hi and thanks for the feedback! Pity to know Heroku is still running Node v.0.4.x.

  1. I guess that can be fixed with a JSON.parse(fs.readFileSync('./package.json').toString()).version; Uglier but it works.

  2. Good idea. Will do.

  3. Thanks for pointing that out, I'll change it pathname + search then.

@tvishwanadha
Copy link
Author

Final nitpick, might be worthwhile to say:

var request_compressed = (options.compressed && typeof unzip != 'undefined') || false;

to make sure you don't ever request gzip on 0.4.x.

Thanks so much for the responsiveness -- really appreciate it

@tomas
Copy link
Owner

tomas commented Jan 17, 2012

Ok pushed and published 0.1.7 in npm. Thanks for the feedback again!

alolis pushed a commit to alolis/needle that referenced this issue Aug 12, 2021
* Replace arrow functions with functions
* Replace spread operator with .apply and Array methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants