Skip to content

Commit

Permalink
fixed npmignore
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrox committed Sep 26, 2015
1 parent d172c6e commit 2e5674c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 38 deletions.
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
src/
src/
.idea/
coverage/
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ Everyone is encouraged to help improve this project. Here are a few ways you can

Haikunator is also available in other languages. Check them out:

- PHP: https://github.com/Atrox/haikunatorphp
- .NET: https://github.com/Atrox/haikunator.net
- Python: https://github.com/Atrox/haikunatorpy
- PHP: https://github.com/Atrox/haikunatorphp
- Java: https://github.com/Atrox/haikunatorjava
- Dart: https://github.com/Atrox/haikunatordart
- Ruby: https://github.com/usmanbashir/haikunator
- Go: https://github.com/yelinaung/go-haikunator
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haikunator",
"version": "1.0.0",
"version": "1.0.1",
"description": "Generate Heroku-like random names to use in your node applications.",
"main": "lib/haikunator.js",
"scripts": {
Expand Down
70 changes: 36 additions & 34 deletions src/haikunator.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,47 @@
let 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", "lucky", "odd", "tiny",
"free", "dry", "yellow", "orange", "gentle", "tight", "super", "royal", "broad",
"steep", "flat", "square", "round", "mute", "noisy", "hushy", "raspy", "soft",
"shrill", "rapid", "sweet", "curly", "calm", "jolly", "fancy", "plain", "shinny"
"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", "lucky", "odd", "tiny",
"free", "dry", "yellow", "orange", "gentle", "tight", "super", "royal", "broad",
"steep", "flat", "square", "round", "mute", "noisy", "hushy", "raspy", "soft",
"shrill", "rapid", "sweet", "curly", "calm", "jolly", "fancy", "plain", "shinny"
];
let 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", "atom", "band", "bar", "base", "block", "boat",
"term", "credit", "art", "fashion", "truth", "disk", "math", "unit", "cell",
"scene", "heart", "recipe", "union", "limit", "bread", "toast", "bonus",
"lab", "mud", "mode", "poetry", "tooth", "hall", "king", "queen", "lion", "tiger",
"penguin", "kiwi", "cake", "mouse", "rice", "coke", "hola", "salad", "hat"
"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", "atom", "band", "bar", "base", "block", "boat",
"term", "credit", "art", "fashion", "truth", "disk", "math", "unit", "cell",
"scene", "heart", "recipe", "union", "limit", "bread", "toast", "bonus",
"lab", "mud", "mode", "poetry", "tooth", "hall", "king", "queen", "lion", "tiger",
"penguin", "kiwi", "cake", "mouse", "rice", "coke", "hola", "salad", "hat"
];

export default function haikunate({delimiter='-', tokenLength=4, tokenHex=false, tokenChars="0123456789"} = {}) {
let adj, noun, i, sections, token = "";
let adj, noun, i, sections, token = "";

if (tokenHex === true) tokenChars = "0123456789abcdef";
if (tokenHex === true) tokenChars = "0123456789abcdef";

adj = adjs[Math.floor(Math.random() * adjs.length)];
noun = nouns[Math.floor(Math.random() * nouns.length)];
adj = adjs[Math.floor(Math.random() * adjs.length)];
noun = nouns[Math.floor(Math.random() * nouns.length)];

for (i = 0; i < tokenLength; i++) {
token += tokenChars.charAt(Math.floor(Math.random() * tokenChars.length));
}
for (i = 0; i < tokenLength; i++) {
token += tokenChars.charAt(Math.floor(Math.random() * tokenChars.length));
}

sections = [adj, noun, token];
return sections.filter(function (e) { return e === 0 || e; }).join(delimiter);
sections = [adj, noun, token];
return sections.filter(function (e) {
return e === 0 || e;
}).join(delimiter);
}
1 change: 0 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var assert = require("chai").assert,
haikunate = require("../src/haikunator");



describe("testing haikunate", () => {
it("should return 4 digits", () => {
assert.match(haikunate(), /((?:[a-z][a-z]+))(-)((?:[a-z][a-z]+))(-)(\d{4})$/i);
Expand Down

0 comments on commit 2e5674c

Please sign in to comment.