···11-# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22-# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33-44-name: Unit tests
55-66-on:
77- pull_request:
88- branches: [ master ]
99- paths:
1010- - 'index.js'
1111- - 'test.js'
1212- - 'data/*.js'
1313- - 'package-lock.json'
1414-1515-jobs:
1616- build:
1717-1818- runs-on: ubuntu-latest
1919-2020- steps:
2121- - uses: actions/checkout@v2
2222- - name: Use Node.js
2323- uses: actions/setup-node@v1
2424- with:
2525- node-version: 14
2626- - run: npm ci
2727- - run: npm test
···11-# Contributor Covenant Code of Conduct
22-33-## Our Pledge
44-55-In the interest of fostering an open and welcoming environment, we as
66-contributors and maintainers pledge to making participation in our project and
77-our community a harassment-free experience for everyone, regardless of age, body
88-size, disability, ethnicity, sex characteristics, gender identity and expression,
99-level of experience, education, socio-economic status, nationality, personal
1010-appearance, race, religion, or sexual identity and orientation.
1111-1212-## Our Standards
1313-1414-Examples of behavior that contributes to creating a positive environment
1515-include:
1616-1717-* Using welcoming and inclusive language
1818-* Being respectful of differing viewpoints and experiences
1919-* Gracefully accepting constructive criticism
2020-* Focusing on what is best for the community
2121-* Showing empathy towards other community members
2222-2323-Examples of unacceptable behavior by participants include:
2424-2525-* The use of sexualized language or imagery and unwelcome sexual attention or
2626- advances
2727-* Trolling, insulting/derogatory comments, and personal or political attacks
2828-* Public or private harassment
2929-* Publishing others' private information, such as a physical or electronic
3030- address, without explicit permission
3131-* Other conduct which could reasonably be considered inappropriate in a
3232- professional setting
3333-3434-## Our Responsibilities
3535-3636-Project maintainers are responsible for clarifying the standards of acceptable
3737-behavior and are expected to take appropriate and fair corrective action in
3838-response to any instances of unacceptable behavior.
3939-4040-Project maintainers have the right and responsibility to remove, edit, or
4141-reject comments, commits, code, wiki edits, issues, and other contributions
4242-that are not aligned to this Code of Conduct, or to ban temporarily or
4343-permanently any contributor for other behaviors that they deem inappropriate,
4444-threatening, offensive, or harmful.
4545-4646-## Scope
4747-4848-This Code of Conduct applies both within project spaces and in public spaces
4949-when an individual is representing the project or its community. Examples of
5050-representing a project or community include using an official project e-mail
5151-address, posting via an official social media account, or acting as an appointed
5252-representative at an online or offline event. Representation of a project may be
5353-further defined and clarified by project maintainers.
5454-5555-## Enforcement
5656-5757-Instances of abusive, harassing, or otherwise unacceptable behavior may be
5858-reported by contacting the project team at grahammbarber@gmail.com. All
5959-complaints will be reviewed and investigated and will result in a response that
6060-is deemed necessary and appropriate to the circumstances. The project team is
6161-obligated to maintain confidentiality with regard to the reporter of an incident.
6262-Further details of specific enforcement policies may be posted separately.
6363-6464-Project maintainers who do not follow or enforce the Code of Conduct in good
6565-faith may face temporary or permanent repercussions as determined by other
6666-members of the project's leadership.
6767-6868-## Attribution
6969-7070-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
7171-available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
7272-7373-[homepage]: https://www.contributor-covenant.org
7474-7575-For answers to common questions about this code of conduct, see
7676-https://www.contributor-covenant.org/faq
-24
LICENSE
···11-This is free and unencumbered software released into the public domain.
22-33-Anyone is free to copy, modify, publish, use, compile, sell, or
44-distribute this software, either in source code form or as a compiled
55-binary, for any purpose, commercial or non-commercial, and by any
66-means.
77-88-In jurisdictions that recognize copyright laws, the author or authors
99-of this software dedicate any and all copyright interest in the
1010-software to the public domain. We make this dedication for the benefit
1111-of the public at large and to the detriment of our heirs and
1212-successors. We intend this dedication to be an overt act of
1313-relinquishment in perpetuity of all present and future rights to this
1414-software under copyright law.
1515-1616-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1717-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1818-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1919-IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
2020-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2121-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2222-OTHER DEALINGS IN THE SOFTWARE.
2323-2424-For more information, please refer to <http://unlicense.org>
+20
LICENSE.md
···11+MIT License
22+33+Copyright (c) 2025 Graham Barber
44+55+Permission is hereby granted, free of charge, to any person obtaining a copy of
66+this software and associated documentation files (the "Software"), to deal in
77+the Software without restriction, including without limitation the rights to
88+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
99+the Software, and to permit persons to whom the Software is furnished to do so,
1010+subject to the following conditions:
1111+1212+The above copyright notice and this permission notice shall be included in all
1313+copies or substantial portions of the Software.
1414+1515+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1717+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1818+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1919+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2020+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+18-48
README.md
···11-# randimal
11+# @puregarlic/randimal
2233-A random animal name generator, forked from
44-[`random-animal-name-generator`](https://github.com/adzialocha/random-animal-name-generator).
33+A random animal name generator. Returns an alliterated adjective and an animal
44+name, separated by a space.
5566-```js
77-import { generateRandomName } from 'randimal'
66+```ts ignore
77+import { generateRandomName } from "@puregarlic/randimal";
8899-// In some async context...
1010-const name = await generateRandomName()
99+const name = await generateRandomName();
11101212-console.log(name) // Geological Gnu
1111+console.log(name); // Geological Gnu
1312```
14131515-## Differences
1616-1717-`random-animal-name-generator` hasn't been updated in awhile, so here's a list
1818-of adjustments:
1919-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.
1414+Originally based on
1515+[`random-animal-name-generator`](https://github.com/adzialocha/random-animal-name-generator),
1616+then modernized, then moved to Deno. Notable differences
1717+include:
34183535-### Word lists are pre-optimized
1919+- Async dictionary loading
2020+- Consistent capitalization
2121+- Removal of compound animal names
2222+- Removal of some nonexistent animals
36233737-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.
2424+I'm not certain as the the origins of these dictionaries, but there seems to be
2525+some alignment with the Scribblenauts wiki. Be aware that many of the adjectives
2626+are made up.
42274343-### 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.