Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancy name generator in node.js

Is there a fancy name generator in nodejs to create names like heroku does for creating applications ?
I'm thinking of names like "yellow_birds", "beautifull_summer" and stuff like that.
Otherwise, are there any dictionnary to pickup cool words ?

like image 307
Luc Avatar asked Oct 05 '11 19:10

Luc


2 Answers

Not specific to node, but I've found the following haiku generator here. You could adapt it the following way:

function haiku(){
  var adjs = ["autumn", "hidden", "bitter", "misty", "silent", "empty", "dry",
  "dark", "summer", "icy", "delicate", "quiet", "white", "cool", "spring",
  "winter", "patient", "twilight", "dawn", "crimson", "wispy", "weathered",
  "blue", "billowing", "broken", "cold", "damp", "falling", "frosty", "green",
  "long", "late", "lingering", "bold", "little", "morning", "muddy", "old",
  "red", "rough", "still", "small", "sparkling", "throbbing", "shy",
  "wandering", "withered", "wild", "black", "young", "holy", "solitary",
  "fragrant", "aged", "snowy", "proud", "floral", "restless", "divine",
  "polished", "ancient", "purple", "lively", "nameless"]

  , nouns = ["waterfall", "river", "breeze", "moon", "rain", "wind", "sea",
  "morning", "snow", "lake", "sunset", "pine", "shadow", "leaf", "dawn",
  "glitter", "forest", "hill", "cloud", "meadow", "sun", "glade", "bird",
  "brook", "butterfly", "bush", "dew", "dust", "field", "fire", "flower",
  "firefly", "feather", "grass", "haze", "mountain", "night", "pond",
  "darkness", "snowflake", "silence", "sound", "sky", "shape", "surf",
  "thunder", "violet", "water", "wildflower", "wave", "water", "resonance",
  "sun", "wood", "dream", "cherry", "tree", "fog", "frost", "voice", "paper",
  "frog", "smoke", "star"];

  return adjs[Math.floor(Math.random()*(adjs.length-1))]+"_"+nouns[Math.floor(Math.random()*(nouns.length-1))];
}
like image 161
Adrien Avatar answered Nov 06 '22 15:11

Adrien


Take a look to these modules:

  • https://github.com/faker-js/faker, can generate all kinds of fake data, also localised.
  • https://github.com/weaver/moniker, this one seems to do just what you need.
  • https://github.com/nodeca/charlatan
  • https://github.com/boo1ean/casual
  • https://github.com/seancannon/goby
like image 25
Guido Avatar answered Nov 06 '22 16:11

Guido