{"id":22221966,"url":"https://github.com/fabiospampinato/detect-eol","last_synced_at":"2025-03-25T07:44:04.342Z","repository":{"id":65930502,"uuid":"237034504","full_name":"fabiospampinato/detect-eol","owner":"fabiospampinato","description":"Quickly detect the EOL used in a string.","archived":false,"fork":false,"pushed_at":"2024-04-04T22:32:00.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T23:16:26.525Z","etag":null,"topics":["detect","eol","fast","newline","nl","quick"],"latest_commit_sha":null,"homepage":null,"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/fabiospampinato.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},"funding":{"github":"fabiospampinato","custom":"https://www.paypal.me/fabiospampinato"}},"created_at":"2020-01-29T16:51:08.000Z","updated_at":"2023-12-11T16:11:06.000Z","dependencies_parsed_at":"2024-04-04T23:29:44.450Z","dependency_job_id":"56dcfaa1-dd22-4ad0-a5dd-b1e1bcb7047d","html_url":"https://github.com/fabiospampinato/detect-eol","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"d58756469ebf43a033d78f9c08086a52d6b87bea"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdetect-eol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdetect-eol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdetect-eol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiospampinato%2Fdetect-eol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiospampinato","download_url":"https://codeload.github.com/fabiospampinato/detect-eol/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245422921,"owners_count":20612725,"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":["detect","eol","fast","newline","nl","quick"],"created_at":"2024-12-02T23:16:23.425Z","updated_at":"2025-03-25T07:44:04.318Z","avatar_url":"https://github.com/fabiospampinato.png","language":"TypeScript","funding_links":["https://github.com/sponsors/fabiospampinato","https://www.paypal.me/fabiospampinato"],"categories":[],"sub_categories":[],"readme":"# Detect EOL\n\nQuickly detect the EOL used in a string.\n\n## Features\n\n- This returns the most common type of EOL found in the string within a given window length, or the first EOL found after that, or the fallback EOL.\n- You can set the window length to 0 to just assume consistent EOLs, for maximum performance.\n- You can set the window length to Infinity to scan the entire string, for maximum accuracy.\n\n## Install\n\n```sh\nnpm install --save detect-eol\n```\n\n## Usage\n\nThe function has the following interface:\n\n```ts\nfunction ( string: string, options: { fallback: string = '\\n', window: number = 1024 } ): string;\n```\n\nYou can use it like this:\n\n```ts\nimport detectEOL from 'detect-eol';\nimport os from 'os';\n\ndetectEOL ( 'foo\\nbar' ); // =\u003e '\\n'\ndetectEOL ( 'foo\\r\\nbar' ); // =\u003e '\\r\\n'\ndetectEOL ( 'foo\\rbar' ); // =\u003e '\\r'\ndetectEOL ( '' ); // =\u003e '\\n'\ndetectEOL ( '', { fallback: os.EOL } ); // =\u003e os.EOL\n```\n\n## License\n\nMIT © Fabio Spampinato\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdetect-eol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiospampinato%2Fdetect-eol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiospampinato%2Fdetect-eol/lists"}