{"id":15479837,"url":"https://github.com/gr2m/initials","last_synced_at":"2025-12-12T03:11:36.173Z","repository":{"id":14006158,"uuid":"16707605","full_name":"gr2m/initials","owner":"gr2m","description":"extract initials from and add initials to names","archived":false,"fork":false,"pushed_at":"2022-09-23T21:49:25.000Z","size":1615,"stargazers_count":44,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-25T14:23:20.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gr2m.github.io/initials","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/gr2m.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-10T20:05:03.000Z","updated_at":"2024-03-21T18:26:40.000Z","dependencies_parsed_at":"2022-08-31T02:51:42.304Z","dependency_job_id":null,"html_url":"https://github.com/gr2m/initials","commit_stats":null,"previous_names":["gr2m/initials.js"],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Finitials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Finitials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Finitials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gr2m%2Finitials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gr2m","download_url":"https://codeload.github.com/gr2m/initials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252312606,"owners_count":21727823,"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-10-02T04:27:51.809Z","updated_at":"2025-12-12T03:11:31.122Z","avatar_url":"https://github.com/gr2m.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Initials. Because JD is shorter than John Doe\n=============================================\n\n\u003e extracts initials from and adds initials to names\n\n[![Build Status](https://travis-ci.org/gr2m/initials.svg?branch=main)](https://travis-ci.org/gr2m/initials)\n[![Coverage Status](https://coveralls.io/repos/gr2m/initials/badge.svg?branch=main)](https://coveralls.io/r/gr2m/initials?branch=main)\n[![Greenkeeper badge](https://badges.greenkeeper.io/gr2m/initials.svg)](https://greenkeeper.io/)\n\n## Installation\n\nInstall using [npm](https://npmjs.org/) for node.js:\n\n```\nnpm install --save initials\n```\n\n\n## Usage\n\n```js\ninitials('John Doe')\n// 'JD'\n\ninitials(['John Doe', 'Robert Roe'])\n// ['JD', 'RR']\n\n// alias for initials('John Doe')\ninitials.find('John Doe')\n\n// parse name(s)\ninitials.parse('John Doe')\n// {name: 'John Doe', initials: 'JD'}\n\n// add initials to name(s)\ninitials.addTo('John Doe')\n// 'John Doe (JD)'\n\n// pass existing initials for names\ninitials(['John Doe', 'Jane Dane'], {\n  existing: { 'John Doe': 'JD' }\n})\n// ['JD', 'JDa']\n```\n\n## Notes\n\nPreffered initials can be passed in `(JD)`, e.g.\n\n```js\nconsole.log( initials('John Doe (JoDo)') );\n// 'JoDo'\n```\n\nIf a name contains an email, it gets ignored when calculating initials\n\n```js\nconsole.log( initials('John Doe joe@example.com') );\n// 'JD'\n```\n\nIf a name _is_ an email, the domain part gets ignored\n\n```js\nconsole.log( initials('joe@example.com') );\n// 'jo'\n```\n\nWhen passing an Array of names, duplicates of initials are avoided\n\n```js\nconsole.log( initials(['John Doe', 'Jane Dane']) );\n// ['JDo', 'JDa']\n```\n\n## Test\n\n```\nnpm test\n```\n\n\n## LICENSE\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Finitials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgr2m%2Finitials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgr2m%2Finitials/lists"}