{"id":17057056,"url":"https://github.com/bdougherty/better-title-case","last_synced_at":"2025-04-12T17:34:05.986Z","repository":{"id":31866791,"uuid":"129321697","full_name":"bdougherty/better-title-case","owner":"bdougherty","description":"Convert a string to title case using the Daring Fireball rules.","archived":false,"fork":false,"pushed_at":"2022-10-01T22:44:34.000Z","size":741,"stargazers_count":17,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T08:12:16.601Z","etag":null,"topics":["daringfireball","title-case","titlecase"],"latest_commit_sha":null,"homepage":"","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/bdougherty.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}},"created_at":"2018-04-12T23:21:15.000Z","updated_at":"2025-02-05T00:54:34.000Z","dependencies_parsed_at":"2023-01-14T20:00:42.491Z","dependency_job_id":null,"html_url":"https://github.com/bdougherty/better-title-case","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdougherty%2Fbetter-title-case","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdougherty%2Fbetter-title-case/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdougherty%2Fbetter-title-case/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdougherty%2Fbetter-title-case/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdougherty","download_url":"https://codeload.github.com/bdougherty/better-title-case/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248605291,"owners_count":21132142,"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":["daringfireball","title-case","titlecase"],"created_at":"2024-10-14T10:26:20.530Z","updated_at":"2025-04-12T17:34:05.968Z","avatar_url":"https://github.com/bdougherty.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# better-title-case\n\n\u003e Convert a string to title case based on the [Daring Fireball](https://daringfireball.net/2008/05/title_case) rules.\n\n## Rules\n\n- If the string is all-caps, it will be corrected\n- The following words are not capitalized by default: a, an, and, at, but, by, for, in, nor, of, on, or, so, the, to, up, yet, v, v., vs, and vs.\n- Words with capital letters other than the first are assumed to be capitalized properly and are skipped\n- It also skips any word that looks like a file path, file name, or URL\n- The first and last word are always capitalized\n- Sub-strings (those that are within quotes or parens/braces) are capitalized according to the same rules\n\n## Installation\n\n```\n$ npm install --save better-title-case\n```\n\n## Usage\n\n```js\nimport titleCase from 'better-title-case';\nconsole.log(titleCase('Nothing to Be Afraid of?'));\n// Nothing to Be Afraid Of?\n```\n\n## Advanced\n\nYou can configure `better-title-case` to add your own excluded words to the default list, or to prevent the use of the default list by passing a `config` object as the second parameter.\n\n### excludedWords\n\nType: `[string]`\u003cbr\u003e\nDefault: `[]`\n\nAdditional words to exclude from capitalization.\n\n```js\ntitleCase('Nothing to be afraid of?', {\n\texcludedWords: ['be']\n});\n// 'Nothing to be Afraid Of?'\n```\n\n### useDefaultExcludedWords\n\nType: `boolean`\u003cbr\u003e\nDefault: `true`\n\nDisable the usage of the default list of excluded words.\n\n```js\ntitleCase('Nothing to be afraid of?', {\n\tuseDefaultExcludedWords: false\n});\n// 'Nothing To Be Afraid Of?'\n```\n\n### preserveWhitespace\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nMaintain extra whitespace between words. By default, all whitespace between words is collapsed to a single space.\n\n```js\ntitleCase('Nothing  to be   afraid of?', {\n\tpreserveWhitespace: true\n});\n// 'Nothing  To Be   Afraid Of?'\n```\n\n## License\n\nMIT © [Brad Dougherty](https://brad.is)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdougherty%2Fbetter-title-case","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdougherty%2Fbetter-title-case","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdougherty%2Fbetter-title-case/lists"}