{"id":15008086,"url":"https://github.com/indiesoftby/defold-unique-names-generator","last_synced_at":"2025-10-30T12:31:25.058Z","repository":{"id":256956382,"uuid":"856918838","full_name":"indiesoftby/defold-unique-names-generator","owner":"indiesoftby","description":"A simple way to generate unique names in your Defold games.","archived":false,"fork":false,"pushed_at":"2025-01-30T09:37:32.000Z","size":26,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-30T10:30:00.615Z","etag":null,"topics":["defold","defold-library","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/indiesoftby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T13:07:13.000Z","updated_at":"2025-01-30T09:37:36.000Z","dependencies_parsed_at":"2024-09-14T04:13:50.786Z","dependency_job_id":null,"html_url":"https://github.com/indiesoftby/defold-unique-names-generator","commit_stats":null,"previous_names":["indiesoftby/defold-unique-names-generator"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-unique-names-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-unique-names-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-unique-names-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indiesoftby%2Fdefold-unique-names-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indiesoftby","download_url":"https://codeload.github.com/indiesoftby/defold-unique-names-generator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968302,"owners_count":19560586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defold","defold-library","lua"],"created_at":"2024-09-24T19:15:02.437Z","updated_at":"2025-10-30T12:31:24.691Z","avatar_url":"https://github.com/indiesoftby.png","language":"Lua","funding_links":[],"categories":["Libraries"],"sub_categories":["Programming Language"],"readme":"# Unique Names Generator for Defold\n\nThis module provides a simple way to generate unique names in your Defold games. It includes a collection of dictionaries for different types of words, such as adjectives, animals, names, colors, and numbers.\n\n## Installation\n\nTo use this library in your Defold project, add the following URL to your `game.project` dependencies:\n\n    https://github.com/indiesoftby/defold-unique-names-generator/archive/main.zip\n\n## Usage\n\n```lua\nlocal names_generator = require(\"unique_names_generator.names_generator\")\n\nlocal adjectives = require(\"unique_names_generator.dictionaries.adjectives\")\nlocal animals = require(\"unique_names_generator.dictionaries.animals\")\nlocal colors = require(\"unique_names_generator.dictionaries.colors\")\nlocal numbers = require(\"unique_names_generator.dictionaries.numbers\")\n\nfunction init(self)\n    -- Using default dictionaries:\n    local generator = names_generator.new({\n        dictionaries = {\n            colors,\n            adjectives,\n            animals,\n            numbers({ min = 100, max = 999 })\n        },\n        style = \"capital\",\n        separator = \"\"\n    })\n\n    -- Generate 3 names:\n    print(generator.generate())\n    print(generator.generate())\n    print(generator.generate())\n\n    -- Using your own dictionaries:\n    local config = {\n        dictionaries = {\n            {\"stylish\", \"awesome\", \"fantastic\"},\n            {\"boy\", \"girl\", \"cat\"},\n        },\n        separator = \"_\",\n        style = \"lower_case\",\n        random = math.random -- you can pass your own random function if you want\n    }\n\n    local generator2 = names_generator.new(config)\n    print(generator2.generate())\nend\n```\n\n## API Reference\n\n### `names_generator.new(config)`\n\nCreates a new `generator` instance.\n\n**Parameters:**\n- `config` (table): Configuration options for the generator.\n  - `dictionaries` (table): Array of dictionaries to use for name generation.\n  - `separator` (string, optional): Separator to use between words. Default: \"_\"\n  - `style` (string, optional): Style of generated words (\"lower_case\", \"upper_case\", or \"capital\"). Default: \"\"\n  - `random` (function, optional): Random function to use. Default: `math.random`\n\n**Returns:**\n- `table`: A table with the `generate` function to create unique names.\n\n### `generator:generate()`\n\nGenerates a unique name.\n\n**Returns:**\n- `string`: A generated unique name.\n\n## License\n\nThis library is released under the MIT License. See [LICENSE](LICENSE.md) for details.\n\nIt's based on the [unique-names-generator](https://github.com/andreasonny83/unique-names-generator) JavaScript library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-unique-names-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findiesoftby%2Fdefold-unique-names-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findiesoftby%2Fdefold-unique-names-generator/lists"}