1.1.1 • Published 10 months ago

hltbjs v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

How long to beat API wrapper

How long to beat is a web-resource where users can find out how long it will take to beat a game.

This package is simple wrapper around API which allows to fetch data from the website.

npm

Installation

  • npm
npm install hltbjs
  • yarn
yarn add hltbjs

Usage

Search method

It takes two arguments:

  • searchTerm - term used for search;
  • SearchOptions - object where options for search are described. Currently it consists of pageSize option only.
import { search } from 'hltbjs';

// Using promise
search('Call of Duty', { pageSize: 10 }).then(result => console.log(result));

// Using async/await
const foo = async () => {
  const result = await search('Call of Duty', { pageSize: 10 }).then(result => console.log(result));
  console.log(result);
};

foo();
  • Response example:
[
  {
    id: 1464,
    name: 'Call of Duty',
    imageURL: 'https://howlongtobeat.com/games/Codbox.jpg',
    durationMain: 7,
    durationMainExtra: 9,
    durationCompletionist: 9.5,
  },
  {
    id: 27127;
    name: 'Call of Duty: Black Ops III',
    imageURL: 'https://howlongtobeat.com/games/COD_Black_Ops_3.jpg',
    durationMain: 9,
    durationMainExtra: 14.5,
    durationCompletionist: 82.5,
  },
  ...
]
1.1.1

10 months ago

1.1.0

10 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago