https://github.com/hearthsim/hearthstonejson-client
📖 HearthstoneJSON client for browsers and Node.
https://github.com/hearthsim/hearthstonejson-client
hearthstone hearthstonejson
Last synced: 8 months ago
JSON representation
📖 HearthstoneJSON client for browsers and Node.
- Host: GitHub
- URL: https://github.com/hearthsim/hearthstonejson-client
- Owner: HearthSim
- License: isc
- Created: 2016-08-21T12:20:58.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2023-08-29T11:50:15.000Z (almost 3 years ago)
- Last Synced: 2024-09-18T01:12:53.539Z (over 1 year ago)
- Topics: hearthstone, hearthstonejson
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/hearthstonejson-client
- Size: 241 KB
- Stars: 8
- Watchers: 11
- Forks: 3
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# HearthstoneJSON Client
[](https://github.com/HearthSim/npm-hearthstonejson-client/actions/workflows/ci.yml)
[](http://npmjs.com/package/hearthstonejson-client)
Fetches Hearthstone card data from [HearthstoneJSON](https://hearthstonejson.com/).
## Install
Install the package from npm using your favourite package manager:
```
$ yarn add hearthstonejson-client
```
In order to use this package in a browser you'll need something like Webpack or Browserify.
## Examples
```javascript
import HearthstoneJSON from "hearthstonejson-client";
var hsjson = new HearthstoneJSON();
// get the latest data
hsjson.getLatest().then(cards => {
console.log(cards);
});
// specify a language
hsjson.getLatest("deDE").then(cards => {/*...*/});
// specify a certain Hearthstone build number
hsjson.get(54613).then(cards => {/*...*/});
```
## Typings
Typescript typings are included as `index.d.ts` and should automatically be picked up by Typescript.