How long to beat provides information and data about games and how long it will take to finish them.
This library is a simple wrapper api to fetch data from How long to beat (search and detail). It is an awesome website and a great service, also heavily living from community data. Please check the website and support if you like what they are doing.
npm install howlongtobeat --save
let hltb = require('howlongtobeat');
let hltbService = new hltb.HowLongToBeatService();
import { HowLongToBeatService, HowLongToBeatEntry } from 'howlongtobeat';
let hltbService = new HowLongToBeatService();
hltbService.search('Nioh').then(result => console.log(result));
search() will return a Promise
with an Array<HowLongToBeatEntry>
hltbService.detail('36936').then(result => console.log(result)).catch(e => console.error(e));
search() will return a Promise
with an HowLongToBeatEntry
. If the id is not known, an error is thrown, you should catch the Promise anyway.
DeprecationWarning: sys is deprecated. Use util instead.
This seems to come from either soupselect or unirest. Will look into it and at least open an issue.
- Currently only "Main Story" and "Completionist" times are parsed and set
- Error and Exception handling is almost not present, must be improved