# pingpong-api

> A npm package for the Ping Pong API

Latest version **1.1.1** (published 2015-08-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install pingpong-api
pnpm add pingpong-api
yarn add pingpong-api
bun add pingpong-api
```

## 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.1.1 |
| Published | 2015-08-26 |
| First published | 2015-08-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Jonathan Chrisp |
| Maintainers | jonathanchrisp |

## Links

- npm: https://www.npmjs.com/package/pingpong-api
- Repository: https://github.com/jonathanchrisp/pingpong-api
- Homepage: https://github.com/jonathanchrisp/pingpong-api#readme
- Issues: https://github.com/jonathanchrisp/pingpong-api/issues
- npm.io page: https://npm.io/package/pingpong-api

## Dependencies (3)

- [url](https://npm.io/package/url.md) ^0.10.3
- [request](https://npm.io/package/request.md) ^2.54.0
- [underscore](https://npm.io/package/underscore.md) ^1.8.3

## Recent versions

- 1.1.1 (latest) — 2015-08-26
- 1.1.0 — 2015-08-26
- 1.0.0 — 2015-08-24

## README

[![Build Status](https://travis-ci.org/jonathanchrisp/pingpong-api.svg?branch=new-endpoints)](https://travis-ci.org/jonathanchrisp/pingpong-api)
[![npm version](https://badge.fury.io/js/pingpong-api.svg)](http://badge.fury.io/js/pingpong-api)

# pingpong-api
A npm package for the Ping Pong API

## Getting Started
Create a new instance of PingPongAPI passing the configuration options and optional default request options:

```
var PingPongAPI = require('PingPongAPI');

var pingPongApi = new PingPongAPI({
    host: 'yourhost.com',
    port: 3000,
    protocol: 'http'
}, {
    auth: {
        user: 'user',
        pass: 'pass',
        sendImmediately: true
    }
});
```

The client must be created with a `host` or an error will be thrown.

## Using the client
Call `pingPongApi.createPlayer(options, callback)` with the following parameters:

```
@param {object} options The request options to pass with your api call
@param {function} callback A callback function. Will be sent the following params:
    @param {string} error An error
    @param {object} response The server response
    @param {object} body The body of the response
```

An example:

```
// Create a new player
pingPongApi.createPlayer({
    body: {
        name: 'Player Name',
        email: 'player@google.com',
        avatar: 'https://en.gravatar.com/userimage/58744548/cc57284537a0deaf9573c225331f672b.jpg',
        office: 'San Francisco',
        skill: null
    }
}, function(error, response, body) {
        if (error) {
            console.log(error);
        } else {
            console.log(response);
        }
    }
);
```

## Testing
### Unit tests
To run all unit tests within the package run:
```
npm test
```

### Code Style / Lint Checks
To run jshint and jscs checks within the package run:
```
npm run lint
```

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