New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

xkcd

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xkcd

A simple xkcd API

latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

xkcd

A simple xkcd API.

download from npm

npm: xkcd

npm install xkcd --save

examples

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);
});

response data example

{
  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"
}

fields

  • alt (String) Img alt text
  • day (String) The day # as a string
  • img (URL) Img URL
  • link (String) External links (may be empty)
  • month (String) Month number as a string
  • news (String) News
  • num (int) Id
  • safe_title (String) Safe title
  • title (String) Title
  • transcript (String) Transcript
  • year (String) Year

command line

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

Global Installation

npm install -g xkcd

Usage

Usage: xkcd <command>

xkcd          open latest xkcd
xkcd latest   open latest xkcd
xkcd <num>    open xkcd by number
xkcd help     display this page

notes

  • xkcd 404 throws an error since there is no comic for this id.

Keywords

xkcd

FAQs

Package last updated on 02 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts