2.0.3 • Published 9 years ago

bird-locations v2.0.3

Weekly downloads
3
License
UNLICENSED
Repository
github
Last release
9 years ago

bird-list

Database of locations for ebird

How to use

npm install --save bird-locations
var locations = require('bird-locations');

locations.getByCode('US').then((data) => {
    // Metadata for a bird
    console.log(data);

    /*
        {
            countryCode: 'US',
            localAbbrev: 'US',
            name: 'United States',
            nameLong: 'United States of America',
            nameShort: '',
        }
    */
}).catch((error) => {
    console.log(error);
})

API

getAll()

Return all locations

    locations.getAll()

getByCode(code)

Return data for a location

    locations.getByCode(code)

getNiceName(result)

Take the result from getByCode and returns a string

    locations.getNiceName(result)

React Modules

Location search

A wrapper to react-select type-a-head for ebird locations.

var LocationsSearch = require('bird-locations/lib/search');
/**
    Location {
        code: ebird code for location
        label: Nice name of location
    }
*/
<LocationsSearch value={this.state.location} onChange={this.updateLocation} />
2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago