···11-# random-animal-name-generator
11+# ranimal
2233-It's a random animal name generator!
33+A random animal name generator, forked from
44+[`random-animal-name-generator`](https://github.com/adzialocha/random-animal-name-generator).
4556```js
66- const generateRandomAnimalName = require('animal-name-generator')
77- const animalName = generateRandomAnimalName()
88- console.log(animalName)
99-```
77+import { generateRandomName } from 'ranimal'
1081111-With funny animal names!
99+// In some async context...
1010+const name = await generateRandomName()
12111313-```
1414-Geological gnu
1515-Topazine toad
1616-Overluxurious okapi
1717-Easternmost eel
1818-Unagrarian urus
1919-Zombified zebrafinch
2020-Dull dungbeetle
2121-Jumping jaeger
2222-Controversial chimneyswift
2323-Fervid flies
2424-Ethologic eidolonhelvum
2525-Matronal mite
2626-Allied achillestang
2727-Palaeobiologic pinkriverdolphin
2828-Glossophobic goldfish
2929-Qualified queenconch
3030-Exuberant eland
3131-Timely tasmaniantiger
1212+console.log(name) // Geological Gnu
3213```
33143434-## Development
1515+## Differences
35163636-Clone the repository and install all dependencies:
1717+`random-animal-name-generator` hasn't been updated in awhile, so here's a list
1818+of adjustments:
37193838-```
3939-git clone git@github.com:adzialocha/random-animal-name-generator.git
4040-cd random-animal-name-generator
4141-npm install
4242-npm run test
4343-```
2020+### Async by default
2121+2222+The word lists are absolutely massive, with previously upwards of 1700 animals
2323+and nearing 9000 adjectives. Loading these files is less of a problem in Node,
2424+but in the browser, we don't want to wait on these files to load with the main
2525+bundle.
2626+2727+To combat this, the animals list and adjectives lists are loaded via dynamic
2828+import, so you can rely on your bundler's chunking features to load the lists
2929+when their necessary. To support this, **`generateRandomName` is now an async
3030+function.**
3131+3232+In the future, I may consider a synchronous entry, but for now, I think this is
3333+an improvement.
3434+3535+### Word lists are pre-optimized
3636+3737+Whenever `random-animal-name-generator` is included in your application, it
3838+sorts the animal and adjective word lists into new objects keyed by their
3939+starting letter. This is deterministic—the data never changes, and so we don't
4040+need to rearrange it every time! So, the word lists (moved into the `data`
4141+folder and converted to JS modules) are now sorted by first letter by default.
4242+4343+### Other stuff
4444+4545+- Removed (probably) all of the animal names that consist of multiple words. The
4646+ smushed-together animal names were confusing to read.
4747+- Removed some made-up animal names... Not really sure where the data came from,
4848+ but I performed Google searches on a number of them and came up with nothing.
4949+ So, I took them out.
5050+- Capitalized all words on both word lists, since they're names.
5151+5252+## Untouched Stuff
5353+5454+While the adjectives have been capitalized, there are still quite a number of...
5555+creative words in the list. It seems like it came from the Scribblenauts wiki,
5656+which is cool, but it'll take some effort to make sure there are only
5757+dictionary-acknowledged adjectives in this project.