{"id":13447126,"url":"https://github.com/sindresorhus/detect-newline","last_synced_at":"2025-04-04T19:14:47.997Z","repository":{"id":18187383,"uuid":"21304485","full_name":"sindresorhus/detect-newline","owner":"sindresorhus","description":"Detect the dominant newline character of a string","archived":false,"fork":false,"pushed_at":"2023-09-23T02:22:52.000Z","size":24,"stargazers_count":55,"open_issues_count":0,"forks_count":6,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-24T22:22:49.727Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sindresorhus.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":".github/funding.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/security.md","support":null,"governance":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2014-06-28T14:33:02.000Z","updated_at":"2025-01-07T20:10:58.000Z","dependencies_parsed_at":"2023-09-24T06:56:58.611Z","dependency_job_id":null,"html_url":"https://github.com/sindresorhus/detect-newline","commit_stats":{"total_commits":38,"total_committers":9,"mean_commits":4.222222222222222,"dds":"0.23684210526315785","last_synced_commit":"78057f25d73b201958ef7415ecde5d1ab662f2f2"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdetect-newline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdetect-newline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdetect-newline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fdetect-newline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/detect-newline/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246697913,"owners_count":20819462,"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-07-31T05:01:08.902Z","updated_at":"2025-04-04T19:14:47.975Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript"],"sub_categories":[],"readme":"# detect-newline\n\n\u003e Detect the dominant newline character of a string\n\n## Install\n\n```sh\nnpm install detect-newline\n```\n\n## Usage\n\n```js\nimport {detectNewline} from 'detect-newline';\n\ndetectNewline('foo\\nbar\\nbaz\\r\\n');\n//=\u003e '\\n'\n```\n\n## API\n\n### detectNewline(string)\n\nReturns the detected newline or `undefined` when no newline character is found or `\\n` when no dominant newline is present.\n\n### detectNewlineGraceful(unknown)\n\nReturns the detected newline or `\\n` when no newline character is found, no dominant newline is present, or the input is not a string.\n\n## Related\n\n- [detect-newline-cli](https://github.com/sindresorhus/detect-newline-cli) - CLI for this module\n- [detect-indent](https://github.com/sindresorhus/detect-indent) - Detect the indentation of code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fdetect-newline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fdetect-newline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fdetect-newline/lists"}