# gamepad-library

> A suite of Gamepads for use in browser-based applications (ex. games)

Latest version **1.0.0** (published 2023-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install gamepad-library
pnpm add gamepad-library
yarn add gamepad-library
bun add gamepad-library
```

## 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.0 |
| Published | 2023-08-23 |
| First published | 2023-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Muhammad Kassar |
| Maintainers | mk360 |
| Keywords | gamepads, library |

## Links

- npm: https://www.npmjs.com/package/gamepad-library
- Repository: https://github.com/mk360/gamepads-library
- Homepage: https://github.com/mk360/gamepads-library#readme
- Issues: https://github.com/mk360/gamepads-library/issues
- npm.io page: https://npm.io/package/gamepad-library

## Recent versions

- 1.0.0 (latest) — 2023-08-23

## README

## Gamepad Library

A suite of Gamepads for use in browser-based applications (for ex. games).

## Supported Devices

- XInput-compliant controllers (ex. Xbox 360)
- Create a PR to add more!

## Usage example in applications

```js
const { XInput } = require("gamepad-library");

const inputMethod = new XInput();

// in some sort of polling loop

const pad = navigator.getGamepads()[0];
// assuming it is indeed a XInput

const buttons = inputMethod.getPressedButtons(pad);

// check if B button is pressed

if (buttons.includes("B")) {
  // hadoken
}
```

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