GitHub - grant/xkcd: A simple xkcd API

1 min read Original article ↗
var xkcd = require('xkcd');

// Get the current xkcd
xkcd(function (data) {
  console.log(data);
});

// Get a specific xkcd
xkcd(532, function (data) {
  console.log(data);
});
{
  month: "5",
  num: 1369,
  link: "",
  year: "2014",
  news: "",
  safe_title: "TMI",
  transcript: "",
  alt: "'TMI' he whispered, gazing into the sea.",
  img: "http://imgs.xkcd.com/comics/tmi.png",
  title: "TMI",
  day: "16"
}

This module can also be installed as a command line utility.