{"id":23764443,"url":"https://github.com/chaqchase/avgen","last_synced_at":"2026-03-22T22:30:16.373Z","repository":{"id":65742584,"uuid":"598652761","full_name":"chaqchase/avgen","owner":"chaqchase","description":"Avagen - A simple avatar generation tool","archived":false,"fork":false,"pushed_at":"2023-02-09T10:49:56.000Z","size":147,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-27T19:09:14.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/avgen","language":"TypeScript","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/chaqchase.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}},"created_at":"2023-02-07T14:48:37.000Z","updated_at":"2023-03-07T06:15:34.000Z","dependencies_parsed_at":"2023-05-15T03:15:29.321Z","dependency_job_id":null,"html_url":"https://github.com/chaqchase/avgen","commit_stats":null,"previous_names":["chaqchase/avgen","triyanox/avgen"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Favgen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Favgen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Favgen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Favgen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaqchase","download_url":"https://codeload.github.com/chaqchase/avgen/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239938059,"owners_count":19721560,"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":[],"created_at":"2024-12-31T22:18:10.993Z","updated_at":"2026-03-22T22:30:16.334Z","avatar_url":"https://github.com/chaqchase.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Avgen - A simple avatar generation tool\n\n## Installation\n\nYou can install `avgen` using `npm`:\n\n```bash\n$ npm install avgen\n```\nor using `yarn`:\n\n```bash\n$ yarn add avgen\n```\n\n## Usage\n\n`avgen` has a single method `generate` which takes an object with the following properties:\n\n- `name` - The name of the user for which the avatar is to be generated. This is used to generate the initials for the avatar.\n- `path` - The path to the directory where the avatar is to be saved. This is optional and defaults to `/public/avatars`.\n- `background` - The background color of the avatar. This is optional and defaults to `#fafafa`.\n- `color` - The color of the initials. This is optional and defaults to `#18181b`.\n- `fontFamily` - The font family of the initials. This is optional and defaults to `sArial`.\n- `fontStyle` - The font style of the initials. This is optional and defaults to `normal`.\n- `fontWeight` - The font weight of the initials. This is optional and defaults to `normal`.`\n- `height` - The height of the avatar. This is optional and defaults to `1000`.\n- `width` - The width of the avatar. This is optional and defaults to `1000`.\n- `font` - The font of the initials. This is optional and defaults to `Arial`.\n- `case` - The case of the initials. This is optional and defaults to `uppercase`.\n\n\n\n```ts\nimport { AvatarGenerator } from 'avgen';\n\nconst avatar = await AvatarGenerator.generate({\n  name : 'John Doe',\n  path : \"/avatars/\", // default is \"/public/avatars\" relative to the root directory\n})\n\nconsole.log(avatar); // returns the path to the generated avatar\n```\n\n## Register custom fonts\n\nYou can register custom fonts by passing an object or array of objects as a second argument to the `generate` method. The object should have the following properties:\n\n- `family` - The font family name of the font.\n- `path` - The path to the font file.\n\n```ts\nimport { AvatarGenerator } from 'avgen';\n\nconst avatar = await AvatarGenerator.generate({\n  name : 'John Doe',\n  path : \"/avatars/\", // default is \"/public/avatars\" relative to the root directory\n}, {\n  path: cwd() + \"/public/fonts/SFProDisplay-Regular.ttf\",\n  family: \"SFProDisplay-Regular\",\n})\n\nconsole.log(avatar); // returns the path to the generated avatar\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n## Example\n\n![Avatar example](https://raw.githubusercontent.com/triyanox/avgen/master/assets/avatar.png)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Favgen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaqchase%2Favgen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Favgen/lists"}