Doctor Who companions
Doctor Who names: a simple and small npm package to get Doctor Who characters names. Can be useful for data anonymization or username placeholder.
const Generator = ;const gen = ; gen; // 'Rory Williams'genall; // ['Amy Pond', 'Rose Tyler', ... ]gen; // ['River Song', 'Clara Oswald']
Installation
Use yarn
or npm
to install this package:
npm install --global doctor-who# or yarn global add doctor-who
API
constructor(doctors = 'all', language = 'en')
Create a new generator instance. You could choose the language in parameter and which Doctor companions to choose.
const Generator = ; const gen = ;// Same as:const gen = 'all' 'en';
const Generator = ; // Will generate names from only the companions of the 10th and 11th Doctor.const gen = 11 10; // Will generate names from the companions of all Doctors.const gen = 'all'; // Will generate names from the companions of only the 12th doctor.const gen = 12;
random()
Return a random name of a character in Doctor Who.
const Generator = ;const gen = ; gen; // Amy Pond
all()
Return an array containing all names.
const Generator = ;const gen = ; genall; // ['Amy Pond', 'Rose Tyler', ... ]
get(count = 1)
Return an array containing count
names.
const Generator = ;const gen = ; gen; // ['Amy Pond', 'Rose Tyler']
Cli
This tool can also be used from the command line.
$ doctor-whoAmy pond
Usage
$ doctor-who -hUsage: datamanager [options] get a random value Options: -V, --version output the version number -a, --all get all values -l, --language <language> specify language. Available languages are: en -c, --count <n> get n values -r, --random get a random value. Same as without options -h, --help output usage information
Languages
The currently available languages for the names are:
Add yours !
Contribute
Pull requests are welcome ! Feel free to contribute.
Credit
MIT Licensing. Coded by Corentin Thomasset