{"id":16489256,"url":"https://github.com/suddi/string-formatting","last_synced_at":"2025-10-11T18:09:23.273Z","repository":{"id":57372429,"uuid":"79216195","full_name":"suddi/string-formatting","owner":"suddi","description":"NPM string formatting module for string beautification (https://www.npmjs.com/package/string-formatting)","archived":false,"fork":false,"pushed_at":"2020-04-07T10:45:40.000Z","size":197,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-18T04:20:08.234Z","etag":null,"topics":["functional-programming","nodejs","string-beautification","string-formatter"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/string-formatting","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/suddi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-17T10:28:02.000Z","updated_at":"2020-04-07T10:45:42.000Z","dependencies_parsed_at":"2022-09-17T16:01:44.167Z","dependency_job_id":null,"html_url":"https://github.com/suddi/string-formatting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/suddi/string-formatting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suddi%2Fstring-formatting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suddi%2Fstring-formatting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suddi%2Fstring-formatting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suddi%2Fstring-formatting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suddi","download_url":"https://codeload.github.com/suddi/string-formatting/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suddi%2Fstring-formatting/sbom","scorecard":{"id":857201,"data":{"date":"2025-08-11","repo":{"name":"github.com/suddi/string-formatting","commit":"cad6c37ff4d9c19fca7c3ccfc48154364bc48741"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/17 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":"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":"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":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"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 14 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"}},{"name":"Vulnerabilities","score":0,"reason":"25 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T00:09:21.311Z","repository_id":57372429,"created_at":"2025-08-24T00:09:21.311Z","updated_at":"2025-08-24T00:09:21.311Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008298,"owners_count":26084428,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"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":["functional-programming","nodejs","string-beautification","string-formatter"],"created_at":"2024-10-11T13:43:45.089Z","updated_at":"2025-10-11T18:09:23.255Z","avatar_url":"https://github.com/suddi.png","language":"JavaScript","readme":"# string-formatting\n\n[![CircleCI](https://circleci.com/gh/suddi/string-formatting.svg?style=svg)](https://circleci.com/gh/suddi/string-formatting)\n[![codecov](https://codecov.io/gh/suddi/string-formatting/branch/master/graph/badge.svg)](https://codecov.io/gh/suddi/string-formatting)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9e6b6ea7bc1a40e9ab11ab621949a83e)](https://www.codacy.com/app/Suddi/string-formatting)\n[![npm](https://img.shields.io/npm/v/string-formatting.svg)](https://www.npmjs.com/package/string-formatting)\n[![npm](https://img.shields.io/npm/dt/string-formatting.svg)](https://www.npmjs.com/package/string-formatting)\n[![David](https://img.shields.io/david/suddi/string-formatting.svg)](https://david-dm.org/suddi/string-formatting)\n[![David](https://img.shields.io/david/dev/suddi/string-formatting.svg)](https://david-dm.org/suddi/string-formatting?type=dev)\n[![license](https://img.shields.io/github/license/suddi/string-formatting.svg)](https://raw.githubusercontent.com/suddi/string-formatting/master/LICENSE)\n\n[![coverage](https://codecov.io/gh/suddi/string-formatting/branch/master/graphs/commits.svg)](https://codecov.io/gh/suddi/string-formatting)\n\nString formatting module for string beautification, splits string optimally over multiple lines.\nCan be used for formatting addresses.\n\n## Installation\n\n````\nnpm install --save string-formatting\n````\n\n## API\n\n````js\nconst StringFormatter = require('string-formatting');\n\nStringFormatting.apply(\u003cstring-to-be-formatted\u003e, \u003coptions\u003e);\n````\n\nDefault configuration, can be overriden with user-defined options:\n````js\n{\n    numLines: 1,                            // number of lines to format to (numLines and lengthOfLine have overlapping use, please see below)\n    lengthOfLine: [255],                    // length for each line as a number or length for each specific line in an Array (numLines and lengthOfLine have overlapping use, please see below)\n    firstLineRequired: true,                // whether the first line in the array must have a value, else fail\n    splitTokenRegex: / /,                   // regex to split the string with\n    mergeToken: ' '                         // string to merge the string with in case multiple words join on the same line\n};\n````\n\n**NOTE:** When both `numLines` defined and `lengthOfLine` is defined as an Array (where each line can have multiple lengths).\n`string-formatting` requires that the `numLines` and the length of `lengthOfLine` Array be the same.\nThis is because in the scenario where `lengthOfLine` is defined per line, `numLines` is an extraneous value and can be omitted.\n\n## Usage\n\n````js\nconst StringFormatter = require('string-formatting');\n\nconst output = StringFormatting.apply('Hello World!', {\n    lengthOfLine: [5, 6]                    // the first line is allowed to have a maximum length of 5, the second line, a maximum length of 6\n});\nconsole.log(output);\n// ['Hello', 'World!']\n\nconst output = StringFormatting.apply('Hello World! I am Node.js', {\n    numLines: 2,\n    lengthOfLine: 12\n});\nconsole.log(output);\n// ['Hello World!', 'I am Node.js']\n\nconst output = StringFormatting.apply('Hello World!', {\n    lengthOfLine: [2, 100],\n    firstLineRequired: false\n});\nconsole.log(output);\n// ['', 'Hello World!']\n\nconst output = StringFormatting.apply('Hello World!', {\n    lengthOfLine: [4, 6],\n    splitTokenRegex: /[aeiou]/,\n    mergeToken: ';'\n});\nconsole.log(output);\n// ['H;ll', 'W;rld!']\n````\n\nFor more workable examples, please see [fixtures](test/fixtures).\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuddi%2Fstring-formatting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuddi%2Fstring-formatting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuddi%2Fstring-formatting/lists"}