alexarank (1437B)
1 #!/usr/bin/env node 2 3 /*****************************************************************************/ 4 /* */ 5 /* alexarank 0.2.0 */ 6 /* Copyright (c) 2013-2017, Frederic Cambus */ 7 /* https://github.com/fcambus/alexarank */ 8 /* */ 9 /* Created: 2013-12-14 */ 10 /* Last Updated: 2017-02-03 */ 11 /* */ 12 /* alexarank is released under the BSD 2-Clause license. */ 13 /* See LICENSE file for details. */ 14 /* */ 15 /*****************************************************************************/ 16 17 var alexa = require('../lib/alexarank'); 18 19 if (process.argv.length == 2) { 20 console.log('USAGE : alexarank domain\n'); 21 console.log('EXAMPLES: alexarank http://www.echojs.com\n alexarank echojs.com'); 22 process.exit(1); 23 } 24 25 alexa(process.argv[2], function(error, result) { 26 if (!error) { 27 console.log(JSON.stringify(result)); 28 } else { 29 console.log(error); 30 } 31 });