npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

naming-language-generator

v0.8.0

Published

This is code for generating a 'naming language', using the algorithm behind [@unchartedatlas][uncharted]. For more details, see [these notes][notes].

Downloads

2

Readme

Naming language generator

This is code for generating a 'naming language', using the algorithm behind @unchartedatlas. For more details, see these notes.

Example Codepen

Classes

Language

A generated language.

Kind: global class

new Language()

constructor

new Language()

constructor

language.spell() ⇒ String

spell

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeWord(key) ⇒ String

Generate a word from morphemes.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.getMorpheme(key) ⇒ String

Gets a morpheme.

Kind: instance method of Language
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

language.getWord(key) ⇒ String

Generates a word.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.getName(key) ⇒ String

Generates a name from words.

Kind: instance method of Language
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

language.spell() ⇒ String

spell

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeWord(key) ⇒ String

Generate a new word associated with the key from morphemes. I.e. Create a new coded word for 'city'.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.makeMorpheme(key) ⇒ String

Create a new morpheme associated with a key. i.e. land -> [country, land] This would be turned into words later like hillCountry or lakeLand

Kind: instance method of Language
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

language.getMorpheme([key]) ⇒ String

Get a random morpheme associated with the key.

Kind: instance method of Language
Returns: String - The morpheme.

| Param | Type | Default | Description | | --- | --- | --- | --- | | [key] | String | '' | The key to fetch an associated morpheme for. |

language.getWord(key) ⇒ String

Generates a word.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.makeName(key) ⇒ String

Generates a name from words.

Kind: instance method of Language
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

language.translateWord(word) ⇒ String

Get the key for which the word was coded. This is not a real translation, but rather the stem concept for a word.

Kind: instance method of Language
Returns: String - The translated word.

| Param | Type | Description | | --- | --- | --- | | word | String | The word to "translate" |

OrthoLanguage ⇐ Language

OrthoLanguage

Kind: global class
Extends: Language

new OrthoLanguage()

constructor

orthoLanguage.spell() ⇒ String

spell

Kind: instance method of OrthoLanguage
Overrides: spell
Returns: String - A generated syllable.

orthoLanguage.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of OrthoLanguage
Overrides: makeSyllable
Returns: String - A generated syllable.

orthoLanguage.makeWord(key) ⇒ String

Generate a word from morphemes.

Kind: instance method of OrthoLanguage
Overrides: makeWord
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.getMorpheme(key) ⇒ String

Gets a morpheme.

Kind: instance method of OrthoLanguage
Overrides: getMorpheme
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.getWord(key) ⇒ String

Generates a word.

Kind: instance method of OrthoLanguage
Overrides: getWord
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.getName(key) ⇒ String

Generates a name from words.

Kind: instance method of OrthoLanguage
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.makeMorpheme(key) ⇒ String

Create a new morpheme associated with a key. i.e. land -> [country, land] This would be turned into words later like hillCountry or lakeLand

Kind: instance method of OrthoLanguage
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.makeName(key) ⇒ String

Generates a name from words.

Kind: instance method of OrthoLanguage
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

orthoLanguage.translateWord(word) ⇒ String

Get the key for which the word was coded. This is not a real translation, but rather the stem concept for a word.

Kind: instance method of OrthoLanguage
Returns: String - The translated word.

| Param | Type | Description | | --- | --- | --- | | word | String | The word to "translate" |

RandomLanguage ⇐ Language

RandomLanguage

Kind: global class
Extends: Language

new RandomLanguage()

constructor

randomLanguage.spell() ⇒ String

spell

Kind: instance method of RandomLanguage
Overrides: spell
Returns: String - A generated syllable.

randomLanguage.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of RandomLanguage
Overrides: makeSyllable
Returns: String - A generated syllable.

randomLanguage.makeWord(key) ⇒ String

Generate a word from morphemes.

Kind: instance method of RandomLanguage
Overrides: makeWord
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

randomLanguage.getMorpheme(key) ⇒ String

Gets a morpheme.

Kind: instance method of RandomLanguage
Overrides: getMorpheme
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

randomLanguage.getWord(key) ⇒ String

Generates a word.

Kind: instance method of RandomLanguage
Overrides: getWord
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

randomLanguage.getName(key) ⇒ String

Generates a name from words.

Kind: instance method of RandomLanguage
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

randomLanguage.makeMorpheme(key) ⇒ String

Create a new morpheme associated with a key. i.e. land -> [country, land] This would be turned into words later like hillCountry or lakeLand

Kind: instance method of RandomLanguage
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

randomLanguage.makeName(key) ⇒ String

Generates a name from words.

Kind: instance method of RandomLanguage
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

randomLanguage.translateWord(word) ⇒ String

Get the key for which the word was coded. This is not a real translation, but rather the stem concept for a word.

Kind: instance method of RandomLanguage
Returns: String - The translated word.

| Param | Type | Description | | --- | --- | --- | | word | String | The word to "translate" |

Random

Random

Kind: global class

random.shuffle(list) ⇒ Array

Randomize an array

Kind: instance method of Random
Returns: Array - A randomized copy of the original array.

| Param | Type | Description | | --- | --- | --- | | list | Array | The array to randomize. |

random.getRandomFromArray(arr) ⇒ *

Get a random element from the array

Kind: instance method of Random
Returns: * - The random element chosen.

| Param | Type | Description | | --- | --- | --- | | arr | Array | The array to get a random element from. |

random.randomIntBetween(min, max) ⇒ Number

Get a random integer between two numbers.

Kind: instance method of Random
Returns: Number - The random integer.

| Param | Type | Description | | --- | --- | --- | | min | Number | The minimum number to return. | | max | Number | The maximum number to return. |

Language

A generated language.

Kind: global class

new Language()

constructor

new Language()

constructor

language.spell() ⇒ String

spell

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeWord(key) ⇒ String

Generate a word from morphemes.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.getMorpheme(key) ⇒ String

Gets a morpheme.

Kind: instance method of Language
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

language.getWord(key) ⇒ String

Generates a word.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.getName(key) ⇒ String

Generates a name from words.

Kind: instance method of Language
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

language.spell() ⇒ String

spell

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeSyllable() ⇒ String

makeSyllable

Kind: instance method of Language
Returns: String - A generated syllable.

language.makeWord(key) ⇒ String

Generate a new word associated with the key from morphemes. I.e. Create a new coded word for 'city'.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.makeMorpheme(key) ⇒ String

Create a new morpheme associated with a key. i.e. land -> [country, land] This would be turned into words later like hillCountry or lakeLand

Kind: instance method of Language
Returns: String - The generated morpheme.

| Param | Type | | --- | --- | | key | String |

language.getMorpheme([key]) ⇒ String

Get a random morpheme associated with the key.

Kind: instance method of Language
Returns: String - The morpheme.

| Param | Type | Default | Description | | --- | --- | --- | --- | | [key] | String | '' | The key to fetch an associated morpheme for. |

language.getWord(key) ⇒ String

Generates a word.

Kind: instance method of Language
Returns: String - The generated word.

| Param | Type | | --- | --- | | key | String |

language.makeName(key) ⇒ String

Generates a name from words.

Kind: instance method of Language
Returns: String - The generated name.

| Param | Type | | --- | --- | | key | String |

language.translateWord(word) ⇒ String

Get the key for which the word was coded. This is not a real translation, but rather the stem concept for a word.

Kind: instance method of Language
Returns: String - The translated word.

| Param | Type | Description | | --- | --- | --- | | word | String | The word to "translate" |

Utils

Utils

Kind: global class

Utils.capitalize(word) ⇒ String

Capitalize the first letter of a word.

Kind: static method of Utils
Returns: String - The capitalized word.

| Param | Type | Description | | --- | --- | --- | | word | String | The word to capitalize. |

Utils.getRandomFromArray(arr) ⇒ *

Get a random element from the array

Kind: static method of Utils
Returns: * - The random element chosen.

| Param | Type | Description | | --- | --- | --- | | arr | Array | The array to get a random element from. |