# gamebanana

> Async API wrapper for Gamebanana, written for NodeJS.

Latest version **1.0.5** (published 2021-04-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamebanana
pnpm add gamebanana
yarn add gamebanana
bun add gamebanana
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-04-02 |
| First published | 2021-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | spikegd |
| Maintainers | spikehd |
| Keywords | gamebanana, game banana, api, wrapper, async |

## Links

- npm: https://www.npmjs.com/package/gamebanana
- Repository: https://github.com/SpikeHD/gamebanana
- Homepage: https://github.com/SpikeHD/gamebanana#readme
- Issues: https://github.com/SpikeHD/gamebanana/issues
- npm.io page: https://npm.io/package/gamebanana

## Dependencies (1)

- [got](https://npm.io/package/got.md) ^11.8.2

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2021-04-02
- 1.0.4 — 2021-03-25
- 1.0.3 — 2021-03-25
- 1.0.2 — 2021-03-25
- 1.0.1 — 2021-03-25

## README

# GameBanana

Async API wrapper for Gamebanana, written for NodeJS.

![https://github.com/SpikeHD/gamebanana](https://img.shields.io/github/package-json/v/SpikeHD/gamebanana) ![https://github.com/SpikeHD/gamebanana](https://img.shields.io/david/SpikeHD/gamebanana) ![https://www.npmjs.com/package/gamebanana](https://img.shields.io/npm/dw/gamebanana)

## Jump to

* [Installation](#installation)
* [Quick-start](#quick-start)
* [Documentation](#documentation)
* [Examples](#examples)
* [Contributing](#contributing)

# Installation

* With `npm`:
  ```sh
  npm install gamebanana
  ```
* With `yarn`:
  ```sh
  yarn add gamebanana
  ```

# Quick-start

Import into your project:
```js
const gb = require('gamebanana')
```

or with ES6 import/exports:
```js
import gb from 'gamebanana'
```

# Documentation

TODO (too lazy rn, just look at JSDocs for now)

# Examples

### Initializing a client

```js
const { Client } = require('gamebanana')

// Without an API key, since it's not required
const client = new Client()

// With an API key n' stuff (for client.login())
const client = new Client({
  api_key: 'myapikey',
  userid: 'myuserid',
  appid: 'myappid'
})
```

### Initializing an Item

```js
const item = await client.Item.getItem({
  itemtype: 'type',
  itemid: 'id',
  fields: ['fields']
})

// OR with the class directly

const { Item } = require('gamebanana')

const item = new Item({
  itemtype: 'type',
  itemid: 'id',
  fields: ['fields']
})

const data = await item.data()
```

### Initializing a List query

```js
const list = await client.List.list({
  itemtype: 'type',
  field: 'field',
  query: 'searchquery'
})

// OR with the class directly

const { List } = require('gamebanana')

const list = new List({
  itemtype: 'type',
  field: 'field',
  query: 'searchquery'
})

const results = await list.data()
```

### Initializing a Section query

```js
const section = await client.Section.list({
  itemtype: 'type',
  sort: 'sort',
  direction: 'desc',
  page: 1
})

// OR with the class directly

const { Section } = require('gamebanana')

const section = new Section({
  itemtype: 'type',
  sort: 'sort',
  direction: 'desc',
  page: 1
})

const results = await section.data()
```

### Initializing a NewItems submissions query

```js
const submissions = await client.NewItems.getNewItems({
  page: 1
})

// OR with the class directly

const { NewItems } = require('gamebanana')

const submissions = new NewItems({
  page: 1
})

const results = await submissions.data()
```

### Initializing a Member

```js
// Via ID
const member = await client.Member.findByID({
  userid: 1
})

// Via username
const member = await client.Member.findByName({
  username: 'myuser'
})

// OR with the class directly

const { Member } = require('gamebanana')

// With ID
const member = new Member({
  userid: 1
})

// With username
const member = new Member({
  username: 'myuser'
})

const results = await member.find()
```

# Contributing

Issues, PRs, etc. are all welcome!

---
_Source: https://npm.io/package/gamebanana · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
