{"_id":"@apostrophecms/random-words-stable","name":"@apostrophecms/random-words-stable","dist-tags":{"latest":"2.0.1"},"versions":{"2.0.1":{"name":"@apostrophecms/random-words-stable","version":"2.0.1","description":"Generate one or more common English words","main":"index.js","types":"index.d.ts","type":"module","scripts":{"test":"mocha tests/test.js"},"repository":{"type":"git","url":"git+https://github.com/apostrophecms/apostrophe.git","directory":"packages/random-words"},"homepage":"https://github.com/apostrophecms/apostrophe/tree/main/packages/random-words#readme","keywords":["random","words","words","word","generator","sample","text"],"author":{"name":"Apostrophe Technologies"},"license":"MIT","dependencies":{"seedrandom":"^3.0.5"},"devDependencies":{"mocha":"^11.7.5"},"apostropheTestConfig":{"requiresMongo":false},"gitHead":"b3e29f004f514041e1e389293ae67017c60d006e","_id":"@apostrophecms/random-words-stable@2.0.1","bugs":{"url":"https://github.com/apostrophecms/apostrophe/issues"},"_nodeVersion":"24.10.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-h2EDubiPI737473d8WTSvtYAFLPIzOV/XypzRgihbMIxa9uc89D5MtpX6nF16qOO7Dj9ZpTyxvmcrpWv45s/rA==","shasum":"518ae5173c4aadc29d95eff006e934b6a818f8d0","tarball":"https://registry.npmjs.org/@apostrophecms/random-words-stable/-/random-words-stable-2.0.1.tgz","fileCount":7,"unpackedSize":46325,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD7dtnySONwnDKz444sC8s2OV4bkrnfxP0/IeRMvlueYQIhALwSbrVKfQDxylPlYIChGVRQG0Z1eyeJOIs4cQ/XZdtG"}]},"_npmUser":{"name":"boutell","email":"tom@apostrophecms.com"},"directories":{},"maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/random-words-stable_2.0.1_1781112815573_0.6117338738645248"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T17:33:35.365Z","2.0.1":"2026-06-10T17:33:35.712Z","modified":"2026-06-10T17:33:36.094Z"},"maintainers":[{"name":"alexgilbert","email":"alex@apostrophecms.com"},{"name":"boutell","email":"tom@apostrophecms.com"},{"name":"romanek","email":"stuart+npm@apostrophecms.com"},{"name":"bodonkey","email":"robert.means1969+apostrophecms@gmail.com"}],"description":"Generate one or more common English words","homepage":"https://github.com/apostrophecms/apostrophe/tree/main/packages/random-words#readme","keywords":["random","words","words","word","generator","sample","text"],"repository":{"type":"git","url":"git+https://github.com/apostrophecms/apostrophe.git","directory":"packages/random-words"},"author":{"name":"Apostrophe Technologies"},"bugs":{"url":"https://github.com/apostrophecms/apostrophe/issues"},"license":"MIT","readme":"# random-words\n\n## Generate one or more common English words\n\n`random-words` generates random words for use as sample text. We use it to generate random blog posts when testing [Apostrophe](http://apostrophecms.org).\n\nCryptographic-quality randomness is NOT the goal, as speed matters for generating sample text and security does not. As such, `Math.random()` is used in most cases.\n\nThe `seed` option can be used with the `generate` function for situations that require deterministic output. When given the same `seed` with the same input, `generate()` will yield deterministic results, in regards to both actual word selection and the number of words returned (when using `min` and `max`). The underlying implementation of this option utilizes the [seedrandom](https://www.npmjs.com/package/seedrandom) package as a replacement for `Math.random()`.\n\nThe `count` function can be used to calculate the total number of words in the word list that meet the specified minimum and maximum length criteria.\n\nInstallation:\n\n    npm install random-words\n\nExamples:\n\n```js\nimport { generate, count } from \"random-words\";\n\nconsole.log(generate());\n//output: 'army'\n\nconsole.log(generate(5));\n//output: ['army', 'beautiful', 'became', 'if', 'actually']\n\nconsole.log(generate({ minLength: 2 }));\n//output: 'hello'\n\nconsole.log(generate({ maxLength: 6 }));\n//output: 'blue'\n\nconsole.log(generate({ minLength: 5, maxLength: 5 }));\n//output : 'world'\n\nconsole.log(generate({ minLength: 11, maxLength: 10000 })); //maxLength limited to the longest possible word\n//output: 'environment'\n\nconsole.log(generate({ minLength: 10000, maxLength: 5 })); //minLength limited to the maxLength\n//output: 'short'\n\nconsole.log(generate({ min: 3, max: 10 }));\n//output: ['became', 'arrow', 'article', 'therefore']\n\nconsole.log(generate({ exactly: 2 }));\n//output: ['beside', 'between']\n\nconsole.log(generate({ min: 2, max: 3, seed: \"my-seed\" }));\n//output: ['plenty', 'pure']\n\n// this call will yield exactly the same results as the last since the same `seed` was used and the other inputs are identical\nconsole.log(generate({ min: 2, max: 3, seed: \"my-seed\" }));\n//output: ['plenty', 'pure']\n\nconsole.log(generate({ exactly: 5, join: \" \" }));\n//output: 'army beautiful became if exactly'\n\nconsole.log(generate({ exactly: 5, join: \"\" }));\n//output: 'armybeautifulbecameifexactly'\n\nconsole.log(generate({ exactly: 2, minLength: 4 }));\n//output: ['atom', 'window']\n\nconsole.log(generate({ exactly: 5, maxLength: 4 }));\n//output: ['army', 'come', 'eye', 'five', 'fur']\n\nconsole.log(generate({ exactly: 2, minLength: 3, maxLength: 3 }));\n//output: ['you, 'are']\n\nconsole.log(generate({ exactly: 3, minLength: 5, maxLength: 100000 }));\n//output: ['understanding', 'should', 'yourself']\n\nconsole.log(generate({ exactly: 5, wordsPerString: 2 }));\n//output: [ 'salt practical', 'also brief', 'country muscle', 'neighborhood beyond', 'grew pig' ]\n\nconsole.log(generate({ exactly: 5, wordsPerString: 2, separator: \"-\" }));\n//output: [ 'equator-variety', 'salt-usually', 'importance-becoming', 'stream-several', 'goes-fight' ]\n\nconsole.log(\n  generate({\n    exactly: 5,\n    wordsPerString: 2,\n    formatter: (word) => word.toUpperCase(),\n  })\n);\n//output: [ 'HAVING LOAD', 'LOST PINE', 'GAME SLOPE', 'SECRET GIANT', 'INDEED LOCATION' ]\n\nconsole.log(\n  generate({\n    exactly: 5,\n    wordsPerString: 2,\n    formatter: (word, index) => {\n      return index === 0\n        ? word.slice(0, 1).toUpperCase().concat(word.slice(1))\n        : word;\n    },\n  })\n);\n//output: [ 'Until smoke', 'Year strength', 'Pay knew', 'Fallen must', 'Chief arrow' ]\n\nconsole.log(count());\n//output: 1952\n\nconsole.log(count({ minLength: 5 }));\n//output: 1318 \n\nconsole.log(count({ maxLength: 7 }));\n//output: 1649\n\nconsole.log(count({ minLength: 5, maxLength: 7 }));\n//output: 1015\n\n```","readmeFilename":"README.md","_rev":"1-3a82c42401effb47dc5412f1709d3c47"}