An API wrapper to fetch xkcd comics. Includes CLI too!
npm install xkcd-api
var xkcd = require('xkcd-api');
xkcd.latest(function(error, response) {
if (error) {
console.error(error);
} else {
console.log(reponse);
}
});
xkcd.get('comic-id', function(error, response) {
if (error) {
console.error(error);
} else {
console.log(reponse);
}
});
xkcd.random(function(error, response) {
if (error) {
console.error(error);
} else {
console.log(reponse);
}
});
xkcd-api
xkcd-api -l
xkcd-api --latest
xkcd-api -n 1714
xkcd-api --number 1714
xkcd-api -r
xkcd-api --random
You can raise an issue in this repo or mail me at sidhant@hashexclude.com