Have ideas to improve npm?Join in the discussion! »

    catch-pokemon

    0.0.1 • Public • Published

    catch-pokemon Build Status

    Algorithm to catch a pokemon

    Install

    $ npm install --save catch-pokemon
    

    Usage

    const catchPokemon = require('catch-pokemon')
     
    catchPokemon('Pikachu', 'masterball')
    // => All right! Pikachu was caught!

    API

    catchPokemon(pokemon, pokeball, [options])

    returns a promise

    pokemon

    Type: string
    Required

    Pokemon's name

    pokeball

    Type: string
    Options: pokeball, masterball, greatball, ultraball and safariball
    Required

    Pokeball's name

    options

    Type: object

    hp

    Type: integer

    Pokemon's hp

    catchRate

    Type: integer

    Pokemon's catch rate

    asleep

    Type: boolean
    Default: false

    Determine if pokemon is asleep

    frozen

    Type: boolean
    Default: false

    Determine if pokemon is frozen

    paralyzed

    Type: boolean
    Default: false

    Determine if pokemon is paralyzed

    burned

    Type: boolean
    Default: false

    Determine if pokemon is burned

    poisoned

    Type: boolean
    Default: false

    Determine if pokemon is poisoned

    If hp and catchRate are passed it won't look up for these information on API (faster). Otherwise, it will try to find the Pokemon on the API.

    Related

    License

    MIT © Bu Kinoshita

    Install

    npm i catch-pokemon

    DownloadsWeekly Downloads

    3

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • avatar