3.2.9 • Published 2 months ago

@ffflorian/xkcdjs v3.2.9

Weekly downloads
62
License
GPL-3.0
Repository
-
Last release
2 months ago

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
3.2.9

2 months ago

3.2.8

5 months ago

3.2.7

12 months ago

3.2.6

1 year ago

3.2.5

2 years ago

3.2.4

2 years ago

3.2.3

2 years ago

3.2.2

2 years ago

3.2.1

3 years ago

3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.4.0

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.2.18

4 years ago

2.2.17

5 years ago

2.2.16

5 years ago

2.2.15

5 years ago

2.2.14

5 years ago

2.2.13

5 years ago

2.2.12

5 years ago

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.6

5 years ago

2.1.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.5.1

5 years ago

1.5.0

6 years ago

1.4.19

6 years ago

1.4.18

6 years ago

1.4.17

6 years ago

1.4.16

6 years ago

1.4.15

6 years ago

1.4.14

6 years ago

1.4.13

6 years ago

1.4.12

6 years ago

1.4.11

6 years ago

1.4.10

6 years ago

1.4.9

6 years ago

1.4.8

6 years ago

1.4.7

6 years ago

1.4.6

6 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.6

6 years ago

1.3.5

6 years ago

1.3.4

6 years ago

1.3.3

6 years ago

1.3.2

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.0.1

6 years ago