{"id":22021503,"url":"https://github.com/peterbenoit/wordgenerator-api","last_synced_at":"2026-04-27T16:32:53.153Z","repository":{"id":256861908,"uuid":"856626793","full_name":"peterbenoit/WordGenerator-API","owner":"peterbenoit","description":"An API to use WordGenerator.js","archived":false,"fork":false,"pushed_at":"2025-01-15T21:46:05.000Z","size":39,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T08:17:26.048Z","etag":null,"topics":["api","vercel"],"latest_commit_sha":null,"homepage":"https://word-generator-api.vercel.app/api/generate","language":"JavaScript","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/peterbenoit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-09-12T23:00:32.000Z","updated_at":"2025-01-15T21:46:07.000Z","dependencies_parsed_at":"2024-09-13T13:15:04.274Z","dependency_job_id":"7eb17f62-dfe9-48cc-8af4-8cfeb90f0961","html_url":"https://github.com/peterbenoit/WordGenerator-API","commit_stats":null,"previous_names":["peterbenoit/wordgenerator-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/peterbenoit/WordGenerator-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbenoit%2FWordGenerator-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbenoit%2FWordGenerator-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbenoit%2FWordGenerator-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbenoit%2FWordGenerator-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterbenoit","download_url":"https://codeload.github.com/peterbenoit/WordGenerator-API/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterbenoit%2FWordGenerator-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32345804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","vercel"],"created_at":"2024-11-30T06:12:21.422Z","updated_at":"2026-04-27T16:32:53.129Z","avatar_url":"https://github.com/peterbenoit.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Word Generator API\n\nThis project provides a simple API to generate random text based on different word lists, such as Latin and Medieval words. The API is built using Node.js and deployed on Vercel, utilizing the `WordGenerator` class to handle various text generation functionalities.\n\n## API Overview\n\n### Base URL\n\nThe base URL for the API is:\n\n```\nhttps://word-generator-api.vercel.app/api/generate\n```\n\n\n### Endpoints\n\n#### `GET /api/generate`\n\nGenerates random text based on the specified word list and format.\n\n-   **Parameters:**\n\n    -   `wordList` (string): The word list to use (`latin`, `medieval`, `both`). Default is `latin`.\n    -   `format` (string): The output format (`string`, `array`, `hash`). Default is `string`.\n    -   `limit` (number): The maximum number of words or sentences to generate. Use `0` to return all available words. Default is `10`.\n\n-   **Example Request:**\n    ```\n    https://word-generator-api.vercel.app/api/generate?wordList=latin\u0026format=array\u0026limit=5\n    ```\n\n## WordGenerator Class\n\nThe `WordGenerator` class is responsible for generating random text based on predefined word lists. The class allows customization of output, including formatting, limiting word counts, and choosing different word sources.\n\n### Constructor\n\n```javascript\nnew WordGenerator((settings = {}));\n```\n\n-   **settings** (object): Configuration object with the following optional properties:\n    -   `sentence` (object): Defines minimum and maximum sentence length.\n    -   `paragraph` (object): Defines minimum and maximum paragraph length.\n    -   `commaRate` (number): Determines the frequency of commas in the generated text.\n    -   `injectStyling` (boolean): Enables random styling for the text.\n    -   `maxFormattedWords` (number): Limits the number of words with random formatting.\n    -   `wordList` (string): Specifies the word list to use (`latin`, `medieval`, `both`).\n    -   `outputFormat` (string): Defines the output format (`string`, `array`, `hash`).\n    -   `maxWords` (number): Sets a limit on the total number of words.\n\n### Methods\n\n-   **`getOutput(format = 'string', limit = 10)`**: Returns generated text in the specified format and limit.\n\n-   **`getSentence(beginWithLoremIpsum = false)`**: Generates a single sentence with optional \"Lorem ipsum\" start.\n\n-   **`getParagraph(beginWithLoremIpsum = false, wrapWith = \"\")`**: Generates a paragraph with customizable wrapping tags.\n\n## CodePen Project\n\nYou can find a live demonstration of the `WordGenerator` class and various use cases on CodePen:\n\n[CodePen Project - Word Generator](https://000702492.deployed.codepen.website/)\n\n## Getting Started\n\n### Prerequisites\n\n-   **Node.js**: Ensure you have Node.js installed on your local machine.\n-   **Vercel CLI**: Install the Vercel CLI tool for deployment.\n\n### Running Locally\n\n1. Clone the repository:\n    ```\n    git clone https://github.com/yourusername/word-generator-api.git\n    ```\n2. Navigate to the project directory:\n    ```\n    cd word-generator-api\n    ```\n3. Run the Vercel development server:\n    ```\n    vercel dev\n    ```\n\n### Deploying to Vercel\n\nTo deploy this project to Vercel, run:\n\n```\nvercel --prod\n```\n\nFollow the prompts to complete the deployment process.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nFeel free to submit issues or pull requests for new features, bug fixes, or improvements!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterbenoit%2Fwordgenerator-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterbenoit%2Fwordgenerator-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterbenoit%2Fwordgenerator-api/lists"}