Socket
Socket
Sign inDemoInstall

pingpong-api

Package Overview
Dependencies
50
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    pingpong-api

A npm package for the Ping Pong API


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
4.77 MB
Created
Weekly downloads
 

Readme

Source

Build Status npm version

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

FAQs

Last updated on 26 Aug 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc