Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nemodreamer/generators
Procedural generators, for games and fake data.
https://github.com/nemodreamer/generators
Last synced: 2 days ago
JSON representation
Procedural generators, for games and fake data.
- Host: GitHub
- URL: https://github.com/nemodreamer/generators
- Owner: nemoDreamer
- Created: 2021-03-19T00:47:09.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-09-13T15:20:48.000Z (5 months ago)
- Last Synced: 2024-09-14T06:21:47.398Z (5 months ago)
- Language: JavaScript
- Size: 207 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `@nemodreamer/generators`
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
Procedural generators, for games and fake data.
- [API](#api)
* [Modules](#modules)
* [helpers](#helpers)
* [random](#random)
* [generators](#generators)
* [names](#names)
* [LANGUAGES : enum](#languages--enum)## API
### Modules
### helpers
* * *
### random
* [random](#module_helpers.module_random)
* [.getRandom](#module_helpers.module_random.getRandom) ⇒ any
* [.getRange](#module_helpers.module_random.getRange) ⇒ Number
* [.doProbability](#module_helpers.module_random.doProbability) ⇒ Boolean
* * *
############# random.getRandom ⇒ any
**Kind**: static constant of [random
](#module_helpers.module_random)
**Returns**: any
- Random element from input array.
| Param | Type | Description |
| --- | --- | --- |
| arr | [ 'Array' ].<any>
| Input array. |
* * *
############# random.getRange ⇒ Number
**Kind**: static constant of [random
](#module_helpers.module_random)
**Returns**: Number
- A random number between `min` and `max` (including).
| Param | Type |
| --- | --- |
| min | Number
|
| max | Number
|
* * *
############# random.doProbability ⇒ Boolean
**Kind**: static constant of [random
](#module_helpers.module_random)
| Param | Type | Description |
| --- | --- | --- |
| p | Number
| Probability as float between 0-1. |
* * *
### generators
* * *
### names
* [names](#module_generators.module_names)
* [.createName(config)](#module_generators.module_names.createName) ⇒ String
* [.LANGUAGES](#module_generators.module_names.createName.LANGUAGES) : [LANGUAGES
](#LANGUAGES)
* * *
############# names.createName(config) ⇒ String
Creates a name in a given language.
"Languages" are approximations based on basic combination "rules" of selected
vowels/consonants.
**Kind**: static method of [names
](#module_generators.module_names)
**Returns**: String
- A clean, fully (potentially separated/accented) name.
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| config | Object
| | |
| [config.min] | Number
| 1
| Minimum number of syllables. |
| [config.max] | Number
| 3
| Maximum number of syllables. |
| [config.language] | [LANGUAGES
](#LANGUAGES) | | The language of the name. If not specified, a language will be picked at random. |
| [config.debug] | Boolean
| | Return additional information. |
* * *
####################### createName.LANGUAGES : [LANGUAGES
](#LANGUAGES)
**Kind**: static property of [createName
](#module_generators.module_names.createName)
* * *
### LANGUAGES : enum
Language of generated name
**Kind**: global enum
**Read only**: true
**Properties**
- DEFAULT String
- RANDOM String
- NORDIC String
- LATIN String
- GOBLIN String
- MOLE String
- SPIDER String
- BIBO String
* * *