{"id":23246418,"url":"https://github.com/marianmeres/random-human-readable","last_synced_at":"2025-04-06T00:22:12.426Z","repository":{"id":65911196,"uuid":"602161550","full_name":"marianmeres/random-human-readable","owner":"marianmeres","description":"Human readable random string generator. Useful for creating passwords, tokens or just plain text placeholders.","archived":false,"fork":false,"pushed_at":"2023-12-09T22:04:29.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T19:47:28.584Z","etag":null,"topics":["password-generator","string-generator","token-generator"],"latest_commit_sha":null,"homepage":"https://rhr.meres.sk","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marianmeres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-15T16:15:57.000Z","updated_at":"2023-12-12T21:57:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f3dffb0-1206-48c5-9c5e-448b3ca9860b","html_url":"https://github.com/marianmeres/random-human-readable","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"a4b0b7692b8c9c32c3ee90891240b8956f4a39fb"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Frandom-human-readable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Frandom-human-readable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Frandom-human-readable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marianmeres%2Frandom-human-readable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marianmeres","download_url":"https://codeload.github.com/marianmeres/random-human-readable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247417584,"owners_count":20935672,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["password-generator","string-generator","token-generator"],"created_at":"2024-12-19T07:14:53.300Z","updated_at":"2025-04-06T00:22:12.393Z","avatar_url":"https://github.com/marianmeres.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @marianmeres/random-human-readable\n\nSimple utility function to help generating random but human readable\nstrings. The internal english words dictionary has about ~1500 nouns, ~250 adjectives\nand ~130 colors, which makes - **with default options** - over 48 billion unique choices.\n\nShould you worry about collision, you can grow the count of possible choices by orders\nof magnitude by simply increasing the `adjCount/colorsCount/nounsCount/syllablesCount`\noptions and/or setting the `randomizeCase` flag.\n\nPlayground: https://rhr.meres.sk/\n\n## Installation\n\n```shell\n$ npm i @marianmeres/random-human-readable\n```\n\n## Main usage\n\n```javascript\nimport { getRandomHumanReadable } from '@marianmeres/random-human-readable';\n\n// all options are optional, and the generation order is always:\n// 1. adjectives, 2. colors, 3. nouns, 4. syllables, (5. digits, 6. special chars)\ngetRandomHumanReadable({\n\t// number of adjectives to generate\n\tadjCount: 1,\n\t// number of colors to generate\n\tcolorsCount: 1,\n\t// number of nouns to generate\n\tnounsCount: 2,\n\t// number of (nonsense) syllables to generate\n\tsyllablesCount: 0,\n\t// if true, will RanDOmiZe case on generated output\n\trandomizeCase: false,\n\t// string to join the generated words with\n\t// (use explicit `false` to disable joining and return as array of words)\n\tjoinWith: '-',\n\n\t// since many password validators require digits and/or special chars (and this tool\n\t// can be used as a password generator), these are also supported, although they\n\t// are not really human readable (in this context)\n\tdigitsCount: number,\n\tspecialCharsCount: number,\n});\n```\n\nExample results (with default options):\n\n```\nfit-transparent-mouse-phrase\nmassive-navy-wood-joint\nunkempt-cadetblue-hand-branch\nincalculable-brown-quality-tank\nchubby-aquamarine-year-flower\nwooden-springgreen-profit-personal\nprickly-darkblue-incident-schedule\nrefined-blue-reason-policy\nwide-white-contract-transition\nwhispering-burlywood-ring-pizza\n```\n\nor, if you're feeling options-adventurous:\n\n```javascript\ngetRandomHumanReadable({\n\tadjCount: 5,\n\tsyllablesCount: 4,\n\trandomizeCase: true,\n\t// other options will be inherited from the defaults if not provided\n});\n```\n\nyou may get something like this:\n\n```\nshRiLLing-helPLESs-Tiny-jollY-ScrawNy-KHAki-PRiEsT-ZIFuvACy\n```\n\n## Other exposed internals\n\n```typescript\n// internal db\ndata = { adjs, colors, nouns };\n// all below return string\ngetRandomAdj();\ngetRandomColor();\ngetRandomNoun();\ngetRandomVowel();\ngetRandomConsonant();\ngetRandomSyllable();\nrandomizeCase(str);\n\n// somewhat off topic and quite opinionated \"lorem ipsum like\" helpers\ngetRandomSentence(options: Partial\u003cOptions\u003e[] = [], shorterSentenceProbability = 0.33);\ngetRandomParagraph(minSentences = 1, maxSentences = 5, shorterSentenceProbability = 0.33);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianmeres%2Frandom-human-readable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarianmeres%2Frandom-human-readable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarianmeres%2Frandom-human-readable/lists"}