{"id":28903886,"url":"https://github.com/forresst/divide-lines","last_synced_at":"2026-02-13T02:02:45.657Z","repository":{"id":37086000,"uuid":"246599413","full_name":"forresst/divide-lines","owner":"forresst","description":"Divide the lines of a string in a lines object","archived":false,"fork":false,"pushed_at":"2025-02-13T15:02:26.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-28T23:47:16.968Z","etag":null,"topics":["divide","line","lines","object","split","string"],"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/forresst.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-11T14:52:22.000Z","updated_at":"2025-02-13T15:02:30.000Z","dependencies_parsed_at":"2025-02-13T16:22:33.658Z","dependency_job_id":"ffa5f7e3-f7e3-49c0-932d-259fe6cec66b","html_url":"https://github.com/forresst/divide-lines","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/forresst/divide-lines","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forresst%2Fdivide-lines","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forresst%2Fdivide-lines/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forresst%2Fdivide-lines/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forresst%2Fdivide-lines/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forresst","download_url":"https://codeload.github.com/forresst/divide-lines/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forresst%2Fdivide-lines/sbom","scorecard":{"id":407306,"data":{"date":"2025-08-11","repo":{"name":"github.com/forresst/divide-lines","commit":"cfb0d4ba0d8dbc9f49130c36133c25a7690c686c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/forresst/divide-lines/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/forresst/divide-lines/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/forresst/divide-lines/main.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 1 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T21:40:57.759Z","repository_id":37086000,"created_at":"2025-08-18T21:40:57.759Z","updated_at":"2025-08-18T21:40:57.759Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29392821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T00:53:09.511Z","status":"online","status_checked_at":"2026-02-13T02:00:10.076Z","response_time":78,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["divide","line","lines","object","split","string"],"created_at":"2025-06-21T12:06:54.069Z","updated_at":"2026-02-13T02:02:45.652Z","avatar_url":"https://github.com/forresst.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# divide-lines\n\nDivide the lines of a string in a lines object array\n\n[![Coverage Status](https://coveralls.io/repos/github/forresst/divide-lines/badge.svg)](https://coveralls.io/github/forresst/divide-lines)\n[![version](https://img.shields.io/npm/v/divide-lines.svg?style=flat-square)](https://www.npmjs.com/package/divide-lines)\n[![node-version](https://img.shields.io/badge/node-%3E%3D%2010.0-orange.svg?style=flat-square)](https://nodejs.org)\n[![downloads](https://img.shields.io/npm/dm/divide-lines.svg?style=flat-square)](http://npm-stat.com/charts.html?package=divide-lines)\n\n[![MIT License](https://img.shields.io/npm/l/divide-lines.svg?style=flat-square)](https://github.com/forresst/divide-lines/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](https://github.com/forresst/divide-lines/blob/master/CODE_OF_CONDUCT.md)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)\n\n[![Watch on GitHub](https://img.shields.io/github/watchers/forresst/divide-lines.svg?style=social)](https://github.com/forresst/divide-lines/watchers)\n[![Star on GitHub](https://img.shields.io/github/stars/forresst/divide-lines.svg?style=social)](https://github.com/forresst/divide-lines/stargazers)\n\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n  * [Node.js](#nodejs)\n- [API](#api)\n  * [divideLines(input)](#dividelinesinput)\n    + [input](#input)\n    + [return](#return)\n    + [Example](#example)\n- [LICENSE](#license)\n\n## Installation\n\nThis module is distributed via [npm](https://www.npmjs.com/) which is bundled with [node](https://nodejs.org) and should be installed as one of your project's `devDependencies`:\n\n```console\nnpm install --save-dev divide-lines\n```\n\n## Usage\n\n### Node.js\n\n```js\nimport divideLines from 'divide-lines';\n\nconsole.log(divideLines('\\n\\rHello \\r\\n\\n The\\n\\nNice World  '));\n/*\t=\u003e\n\t{\n\t\toriginalString: '\\n\\rHello \\r\\n\\n The\\n\\nNice World  ',\n\t\tlines: [\n\t\t\t{\n\t\t\t\tlineBreak: '\\n',\n\t\t\t\toriginalLine: '\\n'\n\t\t\t},\n\t\t\t{\n\t\t\t\twhitespaceStart: '\\r',\n\t\t\t\twhitespaceEnd: ' ',\n\t\t\t\tcontent: 'Hello',\n\t\t\t\tlineBreak: '\\r\\n',\n\t\t\t\toriginalLine: '\\rHello \\r\\n'\n\t\t\t},\n\t\t\t{\n\t\t\t\tlineBreak: '\\n',\n\t\t\t\toriginalLine: '\\n'\n\t\t\t},\n\t\t\t{\n\t\t\t\twhitespaceStart: ' ',\n\t\t\t\tcontent: 'The',\n\t\t\t\tlineBreak: '\\n',\n\t\t\t\toriginalLine: ' The\\n'\n\t\t\t},\n\t\t\t{\n\t\t\t\tlineBreak: '\\n',\n\t\t\t\toriginalLine: '\\n'\n\t\t\t},\n\t\t\t{\n\t\t\t\twhitespaceEnd: '  ',\n\t\t\t\tcontent: 'Nice World',\n\t\t\t\toriginalLine: 'Nice World  '\n\t\t\t}\n\t\t]\n\t}\n*/\n```\n\n## API\n\n### divideLines(input)\n\nDivide the lines of a string in a lines object Returns a `object`.\n\n#### input\n\nType: `string`\n\nThe string to divide.\n\n#### return\n\nType: `object`\n\nThe lines object.\n\n#### Example\n\n`index.js`:\n\n\u003e ```js\n\u003e\n\u003e import divideLines from 'divide-lines';\n\u003e\n\u003e console.log(divideLines(''));\n\u003e //=\u003e { originalString: '', lines: [ { originalLine: '' } ] }\n\u003e\n\u003e console.log(divideLines('a'));\n\u003e /*\t=\u003e\n\u003e\t{\n\u003e\t\toriginalString: 'a',\n\u003e\t\tlines: [\n\u003e\t\t\t{\n\u003e\t\t\t\tcontent: 'a',\n\u003e\t\t\t\toriginalLine: 'a'\n\u003e\t\t\t}\n\u003e\t\t]\n\u003e\t}\n\u003e */\n\u003e\n\u003e console.log(divideLines('\\n\\rHello \\r\\n\\n The\\n\\nNice World  '));\n\u003e /*\t=\u003e\n\u003e\t{\n\u003e\t\toriginalString: '\\n\\rHello \\r\\n\\n The\\n\\nNice World  ',\n\u003e\t\tlines: [\n\u003e\t\t\t{\n\u003e\t\t\t\tlineBreak: '\\n',\n\u003e\t\t\t\toriginalLine: '\\n'\n\u003e\t\t\t},\n\u003e\t\t\t{\n\u003e\t\t\t\twhitespaceStart: '\\r',\n\u003e\t\t\t\twhitespaceEnd: ' ',\n\u003e\t\t\t\tcontent: 'Hello',\n\u003e\t\t\t\tlineBreak: '\\r\\n',\n\u003e\t\t\t\toriginalLine: '\\rHello \\r\\n'\n\u003e\t\t\t},\n\u003e\t\t\t{\n\u003e\t\t\t\tlineBreak: '\\n',\n\u003e\t\t\t\toriginalLine: '\\n'\n\u003e\t\t\t},\n\u003e\t\t\t{\n\u003e\t\t\t\twhitespaceStart: ' ',\n\u003e\t\t\t\tcontent: 'The',\n\u003e\t\t\t\tlineBreak: '\\n',\n\u003e\t\t\t\toriginalLine: ' The\\n'\n\u003e\t\t\t},\n\u003e\t\t\t{\n\u003e\t\t\t\tlineBreak: '\\n',\n\u003e\t\t\t\toriginalLine: '\\n'\n\u003e\t\t\t},\n\u003e\t\t\t{\n\u003e\t\t\t\twhitespaceEnd: '  ',\n\u003e\t\t\t\tcontent: 'Nice World',\n\u003e\t\t\t\toriginalLine: 'Nice World  '\n\u003e\t\t\t}\n\u003e\t\t]\n\u003e\t}\n\u003e */\n\u003e ```\n\n## LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforresst%2Fdivide-lines","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforresst%2Fdivide-lines","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforresst%2Fdivide-lines/lists"}