Generator for random strings.
You're writing tests and need to come up with the name of your user stub. Why waste
time hard-coding 'John Doe'
again when you could use 'Count Dooku'
or
'Qui-Gon Jinn'
? Using random string characters makes your tests much more interesting.
This module has ~50 stings and exposes an API for you to get a random one every time you call it.
This module is distributed via [npm][npm] which is bundled with [node][node] and should be installed as one of your project's dependencies:
npm install --save random-strings-gen
Alternatively you can get the UMD build which is also published to the npm registry and is therefore available via npmcdn.com:
- https://unpkg.com/browse/[email protected]/dist/index.umd.js
- https://unpkg.com/browse/[email protected]/dist/index.umd.min.js
The UMD build exposes the module as a global called gitHubNames
or as an unnamed
module for AMD/CommonJS (require it by its file path)
const gitHubNames = require('random-strings-gen') // CommonJS
console.log(gitHubNames.random()) // Han Solo
console.log(gitHubNames.random()) // Kit Fisto
// you can also get the full array on `gitHubNames.all`
This is actually part of a course instructing people how to create open source projects. So as a result there are dozens of copies of this module on npm. Good luck finding the best :-)
Thanks goes to these wonderful people (emoji key):
Jose Antonio Cabañeros 💻 📖 👀 🔧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT