{"id":18396725,"url":"https://github.com/igorskyflyer/npm-normalized-string","last_synced_at":"2026-05-06T10:31:13.777Z","repository":{"id":171127024,"uuid":"647494525","full_name":"igorskyflyer/npm-normalized-string","owner":"igorskyflyer","description":"💊 NormalizedString provides you with a String type with consistent line-endings, guaranteed. 📮","archived":false,"fork":false,"pushed_at":"2023-07-02T15:36:48.000Z","size":54,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T15:06:26.838Z","etag":null,"topics":["back-end","carriage-return","crlf","endings","igorskyflyer","javascript","js","lf","line-endings","line-feed","node","normalized","normalized-string","skyflyer","string","typescript","utility"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@igor.dvlpr/normalized-string","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/igorskyflyer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"igorskyflyer","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-05-30T22:54:56.000Z","updated_at":"2023-07-18T09:29:37.000Z","dependencies_parsed_at":"2023-07-16T07:02:04.564Z","dependency_job_id":null,"html_url":"https://github.com/igorskyflyer/npm-normalized-string","commit_stats":null,"previous_names":["igorskyflyer/normalized-string"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-normalized-string","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-normalized-string/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-normalized-string/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igorskyflyer%2Fnpm-normalized-string/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igorskyflyer","download_url":"https://codeload.github.com/igorskyflyer/npm-normalized-string/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586235,"owners_count":21128997,"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":["back-end","carriage-return","crlf","endings","igorskyflyer","javascript","js","lf","line-endings","line-feed","node","normalized","normalized-string","skyflyer","string","typescript","utility"],"created_at":"2024-11-06T02:14:40.024Z","updated_at":"2026-05-06T10:31:13.772Z","avatar_url":"https://github.com/igorskyflyer.png","language":"TypeScript","funding_links":["https://ko-fi.com/igorskyflyer"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/npm-normalized-string/main/media/normalized-string.png\" alt=\"Icon of Normalized String\" width=\"256\" height=\"256\"\u003e\n  \u003ch1\u003eNormalized String\u003c/h1\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003ch4 align=\"center\"\u003e\n  💊 NormalizedString provides you with a String type with consistent line-endings, guaranteed. 📮\n\u003c/h4\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📃 Table of Contents\n\n- [Features](#-features)\n- [Usage](#-usage)\n- [API](#-api)\n- [Examples](#️-examples)\n- [Changelog](#-changelog)\n- [Support](#-support)\n- [License](#-license)\n- [Related](#-related)\n- [Author](#-author)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤖 Features\n\n- 🔄 Guarantees consistent line endings across platforms\n- ⚙️ Automatically normalizes text to `LF` or `CRLF` format\n- 🛡️ Prevents mixed or invalid newline styles  \n- 🧩 Extends base transformation logic for easy reuse\n- 📦 Encapsulates normalization in a single class\n- 🚀 Delivers ready-to-use normalized string output\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🕵🏼 Usage\n\nInstall it by executing any of the following, depending on your preferred package manager:\n\n```bash\npnpm add @igorskyflyer/normalized-string\n```\n\n```bash\nyarn add @igorskyflyer/normalized-string\n```\n\n```bash\nnpm i @igorskyflyer/normalized-string\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🤹🏼 API\n\n```ts\nconstructor(value: string, endings: LineEndings = LineEnding.lf)\n```\n\n`value` - A string to work with.\n\n`endings` - The line endings to use:\n\n- `LineEnding.lf` - UNIX-like line endings (line feed),\n\n- `LineEnding.crlf` - Windows line endings (carriage return + line feed).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\nYou can also set the property `value` directly and the line endings will be correct.\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🗒️ Examples\n\n```ts\nimport { NormalizedString, LineEnding } from '@igorskyflyer/normalized-string'\n\nconst loremIpsum: string =\n  'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\r\\n\\r\\nPellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nDuis in nulla ut leo lobortis venenatis.'\n\nconst lfEndings: NormalizedString = new NormalizedString(loremIpsum)\n\nlfEndings.value = 'Hello\\r\\nworld!'\n\nconsole.log(JSON.stringify(lfEndings.value)) // returns 'Hello\\nworld'\n```\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n```ts\nimport { NormalizedString, LineEnding } from '@igorskyflyer/normalized-string'\n\nconst loremIpsum: string =\n  'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\r\\n\\r\\nPellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nDuis in nulla ut leo lobortis venenatis.'\n\nconst lfEndings: NormalizedString = new NormalizedString(loremIpsum) // LF are the default endings\nconst crlfEndings: NormalizedString = new NormalizedString(loremIpsum, LineEnding.crlf)\n\nconsole.log(JSON.stringify(lfEndings.value)) // returns 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\n\\nPellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\n\\nDuis in nulla ut leo lobortis venenatis.'\nconsole.log(JSON.stringify(crlfEndings.value)) // returns 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.\\r\\n\\r\\nPellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.\\r\\n\\r\\nDuis in nulla ut leo lobortis venenatis.'\n```\n\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 📝 Changelog\n\n📑 The changelog is available here, [CHANGELOG.md](https://github.com/igorskyflyer/npm-normalized-string/blob/main/CHANGELOG.md).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🪪 License\n\nLicensed under the MIT license which is available here, [MIT license](https://github.com/igorskyflyer/npm-normalized-string/blob/main/LICENSE).\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 💖 Support\n\n\u003cdiv align=\"center\"\u003e\n  I work hard for every project, including this one and your support means a lot to me!\n  \u003cbr\u003e\n  Consider buying me a coffee. ☕\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://ko-fi.com/igorskyflyer\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/igorskyflyer/igorskyflyer/main/assets/ko-fi.png\" alt=\"Donate to igorskyflyer\" width=\"180\" height=\"46\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  \u003cbr\u003e\n  \u003cem\u003eThank you for supporting my efforts!\u003c/em\u003e 🙏😊\n\u003c/div\u003e\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 🧬 Related\n\n[@igorskyflyer/zing](https://www.npmjs.com/package/@igorskyflyer/zing)\n\n\u003e _🐌 Zing is a C# style String formatter for JavaScript that empowers Strings with positional arguments - composite formatting. 🚀_\n\n\u003cbr\u003e\n\n[@igorskyflyer/strip-html](https://www.npmjs.com/package/@igorskyflyer/strip-html)\n\n\u003e _🥞 Removes HTML code from the given string. Can even extract text-only from the given an HTML string. ✨_\n\n\u003cbr\u003e\n\n[@igorskyflyer/common-color](https://www.npmjs.com/package/@igorskyflyer/common-color)\n\n\u003e _🎨 Provides common Color-related TypeScript types. 🌈_\n\n\u003cbr\u003e\n\n[@igorskyflyer/astro-escaped-component](https://www.npmjs.com/package/@igorskyflyer/astro-escaped-component)\n\n\u003e _🏃🏻‍♂️‍➡️ An Astro component that holds only HTML-encoded content. 📜_\n\n\u003cbr\u003e\n\n[@igorskyflyer/duoscribi](https://www.npmjs.com/package/@igorskyflyer/duoscribi)\n\n\u003e _✒ DúöScríbî allows you to convert letters with diacritics to regular letters. 🤓_\n\n\u003cbr\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\n## 👨🏻‍💻 Author\nCreated by **Igor Dimitrijević** ([*@igorskyflyer*](https://github.com/igorskyflyer/)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-normalized-string","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figorskyflyer%2Fnpm-normalized-string","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figorskyflyer%2Fnpm-normalized-string/lists"}