UNPKG

@xaroth8088/random-names

Version:

A random name generator for all kinds of things

26 lines (24 loc) 5.4 kB
import { sample } from 'lodash-es'; export default function hungerGames() { let names; let rnd; const type = Math.floor(Math.random() * 3.0); const nmM = ['Acee', 'Affron', 'Aldar', 'Alder', 'Allio', 'Allium', 'Almond', 'Apratis', 'Ardar', 'Ardor', 'Arfaj', 'Ash', 'Bage', 'Baoba', 'Bauble', 'Bead', 'Beads', 'Birch', 'Birr', 'Blacaw', 'Brier', 'Burch', 'Cabe', 'Cabel', 'Calyp', 'Chester', 'Chrysan', 'Chryss', 'Clover', 'Coake', 'Coakum', 'Coil', 'Coile', 'Colard', 'Colic', 'Collar', 'Collard', 'Collic', 'Collort', 'Colwort', 'Cornel', 'Cornell', 'Cress', 'Crocas', 'Curio', 'Currio', 'Deecee', 'Deezee', 'Devis', 'Devise', 'Dewda', 'Duscle', 'Dussel', 'Edel', 'Farn', 'Fellord', 'Fennal', 'Fennel', 'Flax', 'Flint', 'Froll', 'Frollick', 'Gadge', 'Gadget', 'Galvan', 'Galve', 'Garget', 'Gear', 'Geare', 'Gimm', 'Gimmick', 'Glint', 'Gordal', 'Gordald', 'Gordaldo', 'Hald', 'Haldin', 'Harl', 'Helbor', 'Hibis', 'Jolt', 'Junk', 'Keek', 'Kinnik', 'Kooza', 'Kousa', 'Kouza', 'Kuds', 'Kudz', 'Kudzu', 'Leome', 'Light', 'Marel', 'Mimosa', 'Morel', 'Morrel', 'Mox', 'Neam', 'Neem', 'Nemo', 'Nettle', 'Oak', 'Ornam', 'Osage', 'Osier', 'Owk', 'Parsley', 'Parsnip', 'Paslee', 'Pasnip', 'Peesta', 'Pellitor', 'Pista', 'Pocan', 'Poplars', 'Prong', 'Rantee', 'Rantipo', 'Rantipol', 'Rhuba', 'Rhubar', 'Rigg', 'Riggs', 'Rye', 'Saffran', 'Saffron', 'Sanguin', 'Sarrel', 'Scoke', 'Scotch', 'Sorrel', 'Spark', 'Sparks', 'Syca', 'Sycamo', 'Tanz', 'Tassel', 'Tazzel', 'Thist', 'Torrac', 'Triffel', 'Triffle', 'Trill', 'Trillium', 'Trink', 'Trinket', 'Tuls', 'Tulsee', 'Vanil', 'Vender', 'Vim', 'Waln', 'Weiss', 'Yarro', 'Yarrow', 'Zedo', 'Zedoary']; const nmF = ['Acey', 'Aldera', 'Allium', 'Alyss', 'Alyssum', 'Amara', 'Amaran', 'Amaryll', 'Amaryllis', 'Ambro', 'Ambrosia', 'Aster', 'Azalea', 'Azo', 'Azolla', 'Baubelle', 'Bauble', 'Beade', 'Birches', 'Birr', 'Birre', 'Brier', 'Brierre', 'Cabbyge', 'Cabil', 'Calyptis', 'Calyptus', 'Carro', 'Catlina', 'Chickpea', 'Chrysa', 'Chrysanthe', 'Cleome', 'Clove', 'Clover', 'Cocone', 'Coilee', 'Cornille', 'Cresh', 'Cress', 'Daffodil', 'Daffodille', 'Dahlia', 'Dahlis', 'Daisy', 'Daizee', 'Deecee', 'Deecey', 'Dew', 'Dewda', 'Doodi', 'Duscle', 'Edel', 'Edelwyse', 'Elbora', 'Elbore', 'Ethelia', 'Eytelia', 'Eytelle', 'Fern', 'Ferne', 'Flaire', 'Flare', 'Flaxe', 'Fodille', 'Gadges', 'Gadget', 'Gidget', 'Gimmick', 'Glinte', 'Haldi', 'Harquin', 'Harquinne', 'Helbora', 'Hibis', 'Ibiscus', 'Iry', 'Iwy', 'Izy', 'Keek', 'Kinni', 'Kinniki', 'Kousha', 'Lavender', 'Lavenne', 'Light', 'Marjoree', 'Marjory', 'Mesqi', 'Mesquite', 'Mimo', 'Mimosa', 'Morelle', 'Moxi', 'Moxie', 'Neem', 'Neeme', 'Nettelle', 'Nettle', 'Nilla', 'Orna', 'Osa', 'Osage', 'Osie', 'Parsley', 'Paslee', 'Pea', 'Pellee', 'Pellitory', 'Pista', 'Pleur', 'Pleuris', 'Pleurisy', 'Pocanne', 'Poplaire', 'Pudina', 'Pudine', 'Rhubae', 'Riggee', 'Rye', 'Saffreen', 'Saffrin', 'Saffron', 'Saguine', 'Santhe', 'Sparkle', 'Sparkley', 'Sycae', 'Sycamore', 'Tansee', 'Tansy', 'Tassel', 'Tasselle', 'Thistle', 'Tilsee', 'Tine', 'Tipole', 'Tissel', 'Trifle', 'Trillium', 'Trilly', 'Trink', 'Trinkee', 'Trinket', 'Trinks', 'Tulsee', 'Tulsi', 'Vanilee']; const nmN = ['Acee', 'Acey', 'Alder', 'Allio', 'Allium', 'Amaran', 'Amaryll', 'Amaryllis', 'Ambro', 'Ash', 'Azo', 'Bauble', 'Beade', 'Birch', 'Birr', 'Birre', 'Brier', 'Cabe', 'Cabel', 'Cabil', 'Chrysan', 'Clove', 'Coile', 'Coilee', 'Cornel', 'Cornell', 'Cresh', 'Cress', 'Deecee', 'Deecey', 'Deezee', 'Duscle', 'Dussel', 'Edel', 'Fennal', 'Fennel', 'Flaxe', 'Gadget', 'Gimmick', 'Glinte', 'Haldi', 'Haldin', 'Hibis', 'Jolt', 'Keek', 'Kinnik', 'Lavenne', 'Leome', 'Light', 'Mesqi', 'Mesquite', 'Mimo', 'Mimosa', 'Morel', 'Morrel', 'Mox', 'Neam', 'Neem', 'Nemo', 'Nettle', 'Osa', 'Parsley', 'Parsnip', 'Paslee', 'Pasnip', 'Pea', 'Pista', 'Pocan', 'Poplaire', 'Prong', 'Riggee', 'Riggs', 'Rye', 'Saffran', 'Saffrin', 'Saffron', 'Sarrel', 'Sorrel', 'Spark', 'Sparkle', 'Sparks', 'Syca', 'Sycamo', 'Sycamore', 'Tazzel', 'Thist', 'Trifle', 'Trillium', 'Trilly', 'Trink', 'Trinkee', 'Trinket', 'Trinks', 'Tuls', 'Tulsee', 'Vender']; const nm4 = ['Amber', 'Ash', 'Bell', 'Bright', 'Bronze', 'Clear', 'Common', 'Copper', 'Dawn', 'Day', 'Dusk', 'Earth', 'Ever', 'Fair', 'Far', 'Flat', 'Gallo', 'Green', 'Hard', 'Hawk', 'Heaven', 'Keen', 'Little', 'Lock', 'Low', 'Meadow', 'Mild', 'Night', 'Ocean', 'Over', 'Peace', 'Pit', 'Plain', 'River', 'Rose', 'Sea', 'Silent', 'Silver', 'Single', 'Sky', 'Solid', 'Spotted', 'Spring', 'Steel', 'Thorne', 'Under', 'Well', 'Wheat', 'White', 'Wild']; const nm5 = ['berg', 'berry', 'bloom', 'blossom', 'brand', 'breath', 'breeze', 'brook', 'bush', 'creek', 'drop', 'dust', 'fall', 'feather', 'flake', 'forest', 'forge', 'gaze', 'grove', 'hair', 'heart', 'hill', 'horn', 'leaf', 'lock', 'mark', 'path', 'petal', 'rock', 'root', 'sand', 'scape', 'shire', 'smith', 'snow', 'song', 'star', 'stone', 'thorn', 'tide', 'tree', 'vale', 'ville', 'water', 'way', 'willow', 'wind', 'wing', 'wood', 'worth']; { if (type === 1) { rnd = Math.floor(Math.random() * nmF.length); names = `${nmF[rnd]} ${sample(nm4)}${sample(nm5)}`; } else if (type === 2) { rnd = Math.floor(Math.random() * nmN.length); names = `${nmN[rnd]} ${sample(nm4)}${sample(nm5)}`; } else { rnd = Math.floor(Math.random() * nmM.length); names = `${nmM[rnd]} ${sample(nm4)}${sample(nm5)}`; } return names; } }