@ffflorian/xkcdjs
An xkcd API client with a CLI.
Last updated 3 days ago by ffflorian .
GPL-3.0 · Repository · Original npm · Tarball · package.json
$ cnpm install @ffflorian/xkcdjs 
SYNC missed versions from official npm registry.

xkcdjs npm version

An xkcd API client with a CLI.

Usage

A complete documentation is available at https://ffflorian.github.io/api-clients/packages/xkcdjs/.

CLI

To use xkcdjs globally, run yarn global add @ffflorian/xkcdjs or npm i -g @ffflorian/xkcdjs.

Usage: xkcdjs [options] [command]

An xkcd API client with a CLI.

Options:
  -v, --version       output the version number
  -o, --output <dir>  Specify the output directory (default: current directory)
  -h, --help          output usage information

Commands:
  latest              Save the latest comic
  random              Save a random comic
  number <index>      Save comic by index number

Installation

Run yarn add @ffflorian/xkcdjs or npm install @ffflorian/xkcdjs.

Example

import {XKCD} from '@ffflorian/xkcdjs';

const xkcd = new XKCD();

xkcd.api.getLatest().then(result => {
  // XKCDResult { ... }
});

xkcd.api.getRandom().then(result => {
  // XKCDResult
});

xkcd.api.getById(2036).then(result => {
  // XKCDResult
});

xkcd.api.getLatest({withData: true}).then(result => {
  // XKCDResultWithData
});

xkcd.api.getRandom({withData: true}).then(result => {
  // XKCDResultWithData
});

xkcd.api.getById(2036, {withData: true}).then(result => {
  // XKCDResultWithData
});

Build and test

yarn
yarn test

Current Tags

  • 2.2.15                                ...           latest (3 days ago)

44 Versions

  • 2.2.15                                ...           3 days ago
  • 2.2.14                                ...           14 days ago
  • 2.2.13                                ...           a month ago
  • 2.2.12                                ...           a month ago
  • 2.2.11                                ...           3 months ago
  • 2.2.10                                ...           4 months ago
  • 2.2.9                                ...           4 months ago
  • 2.2.8                                ...           4 months ago
  • 2.2.7                                ...           4 months ago
  • 2.2.6                                ...           5 months ago
  • 2.1.0                                ...           9 months ago
  • 2.0.1                                ...           10 months ago
  • 2.0.0                                ...           10 months ago
  • 1.5.1                                ...           a year ago
  • 1.5.0                                ...           a year ago
  • 1.4.19                                ...           a year ago
  • 1.4.18                                ...           a year ago
  • 1.4.17                                ...           a year ago
  • 1.4.16                                ...           a year ago
  • 1.4.15                                ...           a year ago
  • 1.4.14                                ...           a year ago
  • 1.4.13                                ...           a year ago
  • 1.4.12                                ...           a year ago
  • 1.4.11                                ...           a year ago
  • 1.4.10                                ...           a year ago
  • 1.4.9                                ...           a year ago
  • 1.4.8                                ...           a year ago
  • 1.4.7                                ...           a year ago
  • 1.4.6                                ...           a year ago
  • 1.4.5                                ...           a year ago
  • 1.4.4                                ...           a year ago
  • 1.4.3                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.6                                ...           a year ago
  • 1.3.5                                ...           2 years ago
  • 1.3.4                                ...           2 years ago
  • 1.3.3                                ...           2 years ago
  • 1.3.2                                ...           2 years ago
  • 1.3.1                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 72
Last Day 0
Last Week 55
Last Month 34
Dependencies (2)
Dev Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |