Skip to content

Commit 747a410

Browse files
committed
npm link and script change
1 parent c42ce28 commit 747a410

File tree

3 files changed

+36
-11
lines changed

3 files changed

+36
-11
lines changed

README.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
# BLIZZARD_API
1+
# BLIZZARD API
22

33
[![JSR Version](https://jsr.io/badges/@pinta365/blizzard-api)](https://jsr.io/@pinta365/blizzard-api)
44

55
Start of what will cover the whole Blizzard Battle.net API when its done.
66

7-
Link to the module on [JSR](https://jsr.io/@pinta365/blizzard-api)
7+
Available as:
8+
9+
- ESM module: [JSR](https://jsr.io/@pinta365/blizzard-api)
10+
- CommonJS module: [NPM](https://www.npmjs.com/package/@pinta365/blizzard_api)
811

912
## WORK IN PROGRESS
1013

@@ -28,7 +31,25 @@ to implement authorization code flow also.
2831
| **StarCraft II:** Community APIs | | |
2932
| **StarCraft II:** Game Data APIs || |
3033

31-
## Example
34+
## ⚡️ Quickstart
35+
36+
**Installation**
37+
38+
```bash
39+
# Deno
40+
deno add @pinta365/blizzard-api
41+
42+
# Bun
43+
bunx jsr add @pinta365/blizzard-api
44+
45+
# Node.js
46+
npx jsr add @pinta365/blizzard-api
47+
48+
# NPM (CommonJS)
49+
npm install @pinta365/blizzard_api --save
50+
```
51+
52+
**Basic Usage (ESM)**
3253

3354
```javascript
3455
import * as blizzardAPI from "@pinta365/blizzard-api";
@@ -43,12 +64,16 @@ blizzardAPI.setup({
4364
locale: "en_GB",
4465
});
4566

46-
try {
47-
const sword = await blizzardAPI.wow.item(33791);
48-
console.log(sword);
49-
} catch (error) {
50-
console.log(error);
51-
}
67+
const sword = await blizzardAPI.wow.item(33791);
68+
console.log(sword);
69+
```
70+
71+
**Basic Usage (CommonJS)**
72+
73+
```javascript
74+
const blizzardAPI = require("@pinta365/blizzard_api");
75+
76+
// Use blizzardAPI the same way as in the previous example.
5277
```
5378

5479
## Issues

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pinta365/blizzard-api",
3-
"version": "0.3.5",
3+
"version": "0.3.6",
44
"exports": "./mod.ts",
55

66
"tasks": {

scripts/build_npm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ await build({
1313
},
1414
package: {
1515
// package.json properties
16-
name: "blizzard_api",
16+
name: "@pinta365/blizzard_api",
1717
version: Deno.args[0],
1818
description:
1919
"TS library to interact with the Blizzard Battle.net API. World of Warcraft, World of Warcraft Classic, StarCraft 2, Diablo 3, Hearthstone.",

0 commit comments

Comments
 (0)