Over the break I took on a toy coding problem which involved building a command-line tool for randomly generating names for things, I called in Namerer.

Namerer is a cross platform (tested on Mac OS X and Windows 10) tool written in JavaScript & TypeScript which executes on top of the Node.js engine. Using the tool is simple, first install it via NPM:

npm install namerer -g

Once Namerer is installed, you can get it to generate a bunch of random strings:

namerer generate

Which will generate something simple like:


You can get it to generate more names simply by adding a -c option to the command, for example:

namerer generate -c 5

This would output something like:


Of course, you might want some more control over what is output, let's say you one character followed by one number. Well there is a simple shortcut syntax for that:

namerer generate -c5 "?#"

This might generate something like this:


As it happens, the ? and # tokens are just shortcuts for the [alpha()] and [numeric()], so you could write the above command as:

namerer generate -c 5 "[alpha()][numeric()]"

If you look closely, you can see that the tokens above aren't just placeholders, but are actually functions which you can pass arguments into:

namerer generate -c 5 "[alpha(3)][numeric(3)]"

This would output something like:


Simple alpha and numeric templates are one thing, but Namerer also supports a bunch of other functions (which are arguably more useful), for example:

namerer generate -c 5 "[synonym('castle')] [syllable()]"

This [synonym('castle')] takes the string castle and calls a web API to look up some synonyms to replace it with, and then the [syllable()] simply outputs a syllable. For this you might get output like:

munition ve
chessman fig
castling um
palace told
move of

Over time I'll be adding a few more functions, but pull requests are welcome.

The other important command (besides generate) that Namerer supports is the filter command. At the moment the filter command simply checks whether the input string has a .com domain available. If I type in the following command:

namerer filter google

This command should output nothing. This is because the google.com domain is taken (obviously). Optionally you can tell the filter command to use a different set of DNS suffixes:

namerer filter -d org.au foofoo

This invocation would output:


Because the foofoo.org.au domain is actually available. The filter command is really designed to take the piped output from the generate command. Here is how I might use it.

namerer generate -c 5 "[syllable()][syllable()]" | namerer filter

This would generate five names (consisting of two syllables each) and pipe it through to the filter command. The eventually output might be:


Even though the generate command spat out five names, we only see two above. That is because the two above were the only ones generated which don't have a .com domain name available.

In the future I'll be adding features for filtering names based on Twitter handles and other well known online services.

That's pretty much a wrap on Namerer for now, hopefully you find it useful. If you've got any thoughts on how to improve it please add an issue on the GitHub page, or even better submit a pull request.

When I get a spare moment I'll write up a post on how I put Namerer together using TypeScript, and used Visual Studio Team Services Build and Release to publish the package out to NPM.