Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

petfinder-promise

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

petfinder-promise

Node module providing Promise based functionality to the PetFinder API

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Petfinder Promise API Client

Node module providing Promise based functionality to the PetFinder API.

Inspired and based off of Meng Fung's petfinder-js

Installation

NPM

npm install petfinder-promise --save

Usage

Example

// Import module
var petfinder = require('petfinder-promise')('API_KEY', 'API_SECRET');

// Get a list of cat breeds
petfinder.breed.list('cat').then(function (breeds) {
    console.log(breeds);
}).catch(function (err) {
    console.log('Error: ' + err.message);
});

Methods

breed.list(animal)

Returns a list of breeds for a particular animal.


pet.get(pet_id)

Returns a record for a single pet.

pet.getRandom(options)

Returns a record for a randomly selected pet. You can choose the characteristics of the pet you want returned using the optional options parameter.

pet.find(location, options)

Searches for pets according to a location and optional criteria.


shelter.find(loation, optional)

Returns a collection of shelter for a given location and optional criteria.

shelter.get(shelter_id)

Returns a record for a single shelter.

shelter.getPets(shelter_id, options)

Returns a collection of pets for an individual shelter.

shelter.listByBreed(animal, breed, options)

Returns a list of shelter IDs listing animals of a particular breed.

Contributing

Contributions and PRs are always welcomed. Please note that this module is a wrapper for petfinder-js and that some bugs, features or functionalities are tied to the original library. Please keep this in mind when submitting bugs.

Branch Strategy

The master branch will be the stable branch. Please submit your PRs against the development branch.

Tests

  1. Make sure to install dev-dependencies
  2. Copy the .env.sample file to .env and make sure to add a developer key and secret.
  3. Run npm test

Keywords

FAQs

Package last updated on 25 Jul 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc