Permalink
Browse files

changed data for 'no pagerank' from undefined to null

  • Loading branch information...
1 parent 529cb92 commit 754904c851ff708410696b1737df3acfa6d78d55 @nfriedly committed Oct 25, 2012
Showing with 6 additions and 6 deletions.
  1. +1 −1 cli.js
  2. +1 −1 package.json
  3. +2 −2 pagerank.js
  4. +2 −2 readme.md
View
2 cli.js
@@ -19,6 +19,6 @@ new PageRank(process.argv[2], function(err, pr) {
console.error(err);
process.exit(2);
}
- console.log(pr === undefined ? -1 : pr);
+ console.log(pr === null ? -1 : pr);
process.exit(0);
});
View
@@ -1,7 +1,7 @@
{
"name": "pagerank",
"description": "Tool for finding the Google PageRank of a given url. Can be used as a node module or a cli command when installed with -g",
- "version": "1.1.0",
+ "version": "1.2.0",
"author": "Nathan Friedly - http://nfriedly.com/",
"repository": {
"type": "git",
View
@@ -10,7 +10,7 @@ var URL = require('url');
* Tool for looking up the Google PageRank of a given domain.
*
* Returns a ReadableStream that will emit a single data event with the pagerank of the
- * site as a number, or `undefined` if the site has no pagerank.
+ * site as a number, or null if the site has no pagerank.
*
*
* Usage:
@@ -166,7 +166,7 @@ pr.get = function(url, callback) {
if (pos != -1) {
self.emit('data', parseInt(body.substr(pos + 9), 10));
} else {
- self.emit('data'); // pagerank is undefined
+ self.emit('data', null); // page does not currently have a pagerank
}
self.emit('end');
});
View
@@ -17,11 +17,11 @@ Usage
new PageRank('http://example.com/').pipe(myCoolWriteableStream);
// It's an event Emitter
- // It will emit one data event with either a number or undefined
+ // It will emit one data event with either a number or null
new PageRank('http://example.com/').on('data', console.log).on('error', console.error);
// And it accepts callbacks
- // pageRank will either be a number or undefined
+ // pageRank will either be a number or null
new PageRank('http://example.com/', function(error, pageRank) {
console.log(error, pageRank);
});

0 comments on commit 754904c

Please sign in to comment.