Skip to content

Commit

Permalink
npm link and script change
Browse files Browse the repository at this point in the history
  • Loading branch information
Pinta365 committed Aug 18, 2024
1 parent c42ce28 commit 747a410
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
43 changes: 34 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# BLIZZARD_API
# BLIZZARD API

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

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

Link to the module on [JSR](https://jsr.io/@pinta365/blizzard-api)
Available as:

- ESM module: [JSR](https://jsr.io/@pinta365/blizzard-api)
- CommonJS module: [NPM](https://www.npmjs.com/package/@pinta365/blizzard_api)

## WORK IN PROGRESS

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

## Example
## ⚡️ Quickstart

**Installation**

```bash
# Deno
deno add @pinta365/blizzard-api

# Bun
bunx jsr add @pinta365/blizzard-api

# Node.js
npx jsr add @pinta365/blizzard-api

# NPM (CommonJS)
npm install @pinta365/blizzard_api --save
```

**Basic Usage (ESM)**

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

try {
const sword = await blizzardAPI.wow.item(33791);
console.log(sword);
} catch (error) {
console.log(error);
}
const sword = await blizzardAPI.wow.item(33791);
console.log(sword);
```

**Basic Usage (CommonJS)**

```javascript
const blizzardAPI = require("@pinta365/blizzard_api");

// Use blizzardAPI the same way as in the previous example.
```

## Issues
Expand Down
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pinta365/blizzard-api",
"version": "0.3.5",
"version": "0.3.6",
"exports": "./mod.ts",

"tasks": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ await build({
},
package: {
// package.json properties
name: "blizzard_api",
name: "@pinta365/blizzard_api",
version: Deno.args[0],
description:
"TS library to interact with the Blizzard Battle.net API. World of Warcraft, World of Warcraft Classic, StarCraft 2, Diablo 3, Hearthstone.",
Expand Down

0 comments on commit 747a410

Please sign in to comment.