jesusprubio / shodan-client

:eyes: Node.js/JavaScript Library for accessing the new Shodan API
MIT License
198 stars 66 forks source link

src/utils.js line 48 callback(null, body) is backwards #9

Closed ghost closed 8 years ago

ghost commented 8 years ago

The callback callback(null,body) sends the data as null and the data in the error code, which is only O.K if your callback is backwards (err, data) but the usual convention is (data, err).

I found this bug while trying to do a basic search and it said I had an error, but all my data was in the error parameter.

jesusprubio commented 8 years ago

First of all thanks for the feedback, as this other user comment the README included a bug. We're supposing to follow the Error-first callback, so the error is always first. :)

https://github.com/jesusprubio/node-shodan-client/issues/10