├── .npmrc ├── .gitattributes ├── .gitignore ├── dofle.jpg ├── index.test-d.ts ├── .github ├── pull_request_template.md └── workflows │ └── main.yml ├── index.js ├── .editorconfig ├── test.js ├── cli.js ├── index.d.ts ├── license ├── package.json ├── cat-names.json └── readme.md /.npmrc: -------------------------------------------------------------------------------- 1 | package-lock=false 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | yarn.lock 3 | -------------------------------------------------------------------------------- /dofle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sindresorhus/cat-names/HEAD/dofle.jpg -------------------------------------------------------------------------------- /index.test-d.ts: -------------------------------------------------------------------------------- 1 | import {expectType} from 'tsd'; 2 | import {catNames, randomCatName} from './index.js'; 3 | 4 | expectType(catNames); 5 | expectType(randomCatName()); 6 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Pull Request Guidelines 2 | 3 | I'm not accepting PRs for additional names. Accepting arbitrary names would create a maintenance nightmare as almost anything could be a cat name. 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import uniqueRandomArray from 'unique-random-array'; 2 | import catNames from './cat-names.json' with {type: 'json'}; 3 | 4 | export {catNames}; 5 | 6 | export const randomCatName = uniqueRandomArray(catNames); 7 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [*.yml] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | import test from 'ava'; 2 | import {catNames, randomCatName} from './index.js'; 3 | 4 | test('main', t => { 5 | t.true(catNames.length > 0); 6 | t.truthy(randomCatName()); 7 | t.not(randomCatName(), randomCatName()); 8 | t.is(catNames[0], 'Abby'); 9 | t.is(catNames[1], 'Angel'); 10 | }); 11 | -------------------------------------------------------------------------------- /cli.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | import meow from 'meow'; 3 | import {catNames, randomCatName} from './index.js'; 4 | 5 | const cli = meow(` 6 | Examples 7 | $ cat-names 8 | Max 9 | 10 | $ cat-names --all 11 | Abby 12 | Angel 13 | … 14 | 15 | Options 16 | --all Get all names instead of a random name 17 | `, { 18 | importMeta: import.meta, 19 | }); 20 | 21 | console.log(cli.flags.all ? catNames.join('\n') : randomCatName()); 22 | -------------------------------------------------------------------------------- /index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | Top 100 cat names in alphabetical order. 3 | 4 | @example 5 | ``` 6 | import {catNames} from 'cat-names'; 7 | 8 | catNames; 9 | //=> ['Abby', 'Angel', …] 10 | ``` 11 | */ 12 | export const catNames: readonly string[]; 13 | 14 | /** 15 | Get a random cat name. 16 | 17 | @example 18 | ``` 19 | import {randomCatName} from 'cat-names'; 20 | 21 | randomCatName(); 22 | //=> 'Max' 23 | ``` 24 | */ 25 | export function randomCatName(): string; 26 | -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | - push 4 | - pull_request 5 | jobs: 6 | test: 7 | name: Node.js ${{ matrix.node-version }} 8 | runs-on: ubuntu-latest 9 | strategy: 10 | fail-fast: false 11 | matrix: 12 | node-version: 13 | - 20 14 | - 18 15 | steps: 16 | - uses: actions/checkout@v4 17 | - uses: actions/setup-node@v4 18 | with: 19 | node-version: ${{ matrix.node-version }} 20 | - run: npm install 21 | - run: npm test 22 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (https://sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cat-names", 3 | "version": "4.0.0", 4 | "description": "Get popular cat names", 5 | "license": "MIT", 6 | "repository": "sindresorhus/cat-names", 7 | "funding": "https://github.com/sponsors/sindresorhus", 8 | "author": { 9 | "name": "Sindre Sorhus", 10 | "email": "sindresorhus@gmail.com", 11 | "url": "https://sindresorhus.com" 12 | }, 13 | "type": "module", 14 | "bin": "./cli.js", 15 | "exports": { 16 | "types": "./index.d.ts", 17 | "default": "./index.js" 18 | }, 19 | "sideEffects": false, 20 | "engines": { 21 | "node": ">=18.20" 22 | }, 23 | "scripts": { 24 | "//test": "xo && ava && tsd", 25 | "test": "ava && tsd" 26 | }, 27 | "files": [ 28 | "index.js", 29 | "index.d.ts", 30 | "cli.js", 31 | "cat-names.json" 32 | ], 33 | "keywords": [ 34 | "cli-app", 35 | "cli", 36 | "bin", 37 | "word", 38 | "words", 39 | "list", 40 | "array", 41 | "random", 42 | "rand", 43 | "animal", 44 | "cat", 45 | "cats", 46 | "kitten", 47 | "name", 48 | "names", 49 | "female", 50 | "male" 51 | ], 52 | "dependencies": { 53 | "meow": "^13.2.0", 54 | "unique-random-array": "^3.0.0" 55 | }, 56 | "devDependencies": { 57 | "ava": "^6.1.2", 58 | "tsd": "^0.31.0", 59 | "xo": "^0.58.0" 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /cat-names.json: -------------------------------------------------------------------------------- 1 | [ 2 | "Abby", 3 | "Angel", 4 | "Annie", 5 | "Baby", 6 | "Bailey", 7 | "Bandit", 8 | "Bear", 9 | "Bella", 10 | "Bob", 11 | "Boo", 12 | "Boots", 13 | "Bubba", 14 | "Buddy", 15 | "Buster", 16 | "Cali", 17 | "Callie", 18 | "Casper", 19 | "Charlie", 20 | "Chester", 21 | "Chloe", 22 | "Cleo", 23 | "Coco", 24 | "Cookie", 25 | "Cuddles", 26 | "Daisy", 27 | "Dusty", 28 | "Felix", 29 | "Fluffy", 30 | "Garfield", 31 | "George", 32 | "Ginger", 33 | "Gizmo", 34 | "Gracie", 35 | "Harley", 36 | "Jack", 37 | "Jasmine", 38 | "Jasper", 39 | "Kiki", 40 | "Kitty", 41 | "Leo", 42 | "Lilly", 43 | "Lily", 44 | "Loki", 45 | "Lola", 46 | "Lucky", 47 | "Lucy", 48 | "Luna", 49 | "Maggie", 50 | "Max", 51 | "Mia", 52 | "Midnight", 53 | "Milo", 54 | "Mimi", 55 | "Miss kitty", 56 | "Missy", 57 | "Misty", 58 | "Mittens", 59 | "Molly", 60 | "Muffin", 61 | "Nala", 62 | "Oliver", 63 | "Oreo", 64 | "Oscar", 65 | "Patches", 66 | "Peanut", 67 | "Pepper", 68 | "Precious", 69 | "Princess", 70 | "Pumpkin", 71 | "Rascal", 72 | "Rocky", 73 | "Sadie", 74 | "Salem", 75 | "Sam", 76 | "Samantha", 77 | "Sammy", 78 | "Sasha", 79 | "Sassy", 80 | "Scooter", 81 | "Shadow", 82 | "Sheba", 83 | "Simba", 84 | "Simon", 85 | "Smokey", 86 | "Snickers", 87 | "Snowball", 88 | "Snuggles", 89 | "Socks", 90 | "Sophie", 91 | "Spooky", 92 | "Sugar", 93 | "Tiger", 94 | "Tigger", 95 | "Tinkerbell", 96 | "Toby", 97 | "Trouble", 98 | "Whiskers", 99 | "Willow", 100 | "Zoe", 101 | "Zoey" 102 | ] 103 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # cat-names 2 | 3 | > Get popular cat names 4 | 5 | ![](dofle.jpg) 6 | 7 | The name list is just a [JSON file](cat-names.json) and can be used anywhere. 8 | 9 | *I'm not accepting PRs for additional names.* 10 | 11 | ## Install 12 | 13 | ```sh 14 | npm install cat-names 15 | ``` 16 | 17 | ## Usage 18 | 19 | ```js 20 | import {catNames, randomCatName} from 'cat-names'; 21 | 22 | catNames; 23 | //=> ['Abby', 'Angel', …] 24 | 25 | randomCatName(); 26 | //=> 'Max' 27 | ``` 28 | 29 | ## API 30 | 31 | ### catNames 32 | 33 | Type: `string[]` 34 | 35 | Top 100 cat names in alphabetical order. 36 | 37 | ### randomCatName() 38 | 39 | Type: `Function` 40 | 41 | Get a random cat name. 42 | 43 | ## CLI 44 | 45 | ```sh 46 | npm install --global cat-names 47 | ``` 48 | 49 | ``` 50 | $ cat-names --help 51 | 52 | Examples 53 | $ cat-names 54 | Max 55 | 56 | $ cat-names --all 57 | Abby 58 | Angel 59 | … 60 | 61 | Options 62 | --all Get all names instead of a random name 63 | ``` 64 | 65 | ## Related 66 | 67 | - [dog-names](https://github.com/sindresorhus/dog-names) - Get popular dog names 68 | - [pokemon](https://github.com/sindresorhus/pokemon) - Get Pokémon names 69 | - [superb](https://github.com/sindresorhus/superb) - Get superb like words 70 | - [superheroes](https://github.com/sindresorhus/superheroes) - Get superhero names 71 | - [supervillains](https://github.com/sindresorhus/supervillains) - Get supervillain names 72 | - [random-tree-names](https://github.com/pguth/random-tree-names) - Get tree names 73 | - [yes-no-words](https://github.com/sindresorhus/yes-no-words) - Get yes/no like words 74 | --------------------------------------------------------------------------------