cat-breeds
Version:
Get cat breeds
65 lines (39 loc) • 1.32 kB
Markdown
# cat-breeds [](https://travis-ci.org/ncamaa/cat-breeds)
> Get cat breeds
A list of cat breeds, including breed origin, type, body type, coat, pattern, and a link to an image of the breed on Wikimedia. Includes comprehensive testing and example projects.
The list is a [JSON file](cat-breeds.json) and can be used anywhere.
## Install
```
$ npm install cat-breeds
```
## Usage
```js
const catBreeds = require('cat-breeds');
catBreeds.random();
/*
{
"breed": "Abyssinian",
"origin": "Unspecified, but somewhere in Afro-Asia, likely Ethiopia",
"type": "Natural",
"bodyType": "Semi-foreign",
"coat": "Short",
"pattern": "Ticked tabby",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/9b/Gustav_chocolate.jpg/120px-Gustav_chocolate.jpg"
}
*/
```
## API
### .all
Type: `Array`
Cat breeds in alphabetical order.
### .random()
Type: `Function`
Random cat breed.
## Testing
This package includes comprehensive testing and example projects:
- **Jest Tests**: 17 tests with 100% coverage
- **Example Backend**: Express.js API server
- **Example Frontend**: HTML/CSS/JavaScript interface
See the `test-projects/` directory for full examples.
## License
MIT © [Nadav Cohen](https://github.com/ncamaa)