{"id":15616995,"url":"https://github.com/justjavac/deno_word_wrap","last_synced_at":"2026-05-19T15:15:32.963Z","repository":{"id":48040064,"uuid":"289253711","full_name":"justjavac/deno_word_wrap","owner":"justjavac","description":"Wrap words to a specified length.","archived":false,"fork":false,"pushed_at":"2022-08-12T09:52:02.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T07:11:22.737Z","etag":null,"topics":["deno","escape","text","trim","word","wrap"],"latest_commit_sha":null,"homepage":"","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/justjavac.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}},"created_at":"2020-08-21T11:31:17.000Z","updated_at":"2022-03-19T04:44:03.000Z","dependencies_parsed_at":"2022-08-12T17:20:30.393Z","dependency_job_id":null,"html_url":"https://github.com/justjavac/deno_word_wrap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/justjavac/deno_word_wrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_word_wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_word_wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_word_wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_word_wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justjavac","download_url":"https://codeload.github.com/justjavac/deno_word_wrap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justjavac%2Fdeno_word_wrap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262978551,"owners_count":23394008,"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":["deno","escape","text","trim","word","wrap"],"created_at":"2024-10-03T07:40:43.240Z","updated_at":"2026-05-19T15:15:32.899Z","avatar_url":"https://github.com/justjavac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno_word_wrap\n\n[![tag](https://img.shields.io/github/release/justjavac/deno_word_wrap)](https://github.com/justjavac/deno_word_wrap/releases)\n[![Build Status](https://github.com/justjavac/deno_word_wrap/workflows/ci/badge.svg?branch=master)](https://github.com/justjavac/deno_word_wrap/actions)\n[![license](https://img.shields.io/github/license/justjavac/deno_word_wrap)](https://github.com/justjavac/deno_word_wrap/blob/master/LICENSE)\n\nWrap words to a specified length.\n\n\u003e base on [jonschlinkert/word-wrap](https://github.com/jonschlinkert/word-wrap)\n\n## Usage\n\n```js\nimport wrap from \"https://deno.land/x/word_wrap/mod.ts\";\n\nwrap(\n  \"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\",\n);\n```\n\nResults in:\n\n```\nLorem ipsum dolor sit amet, consectetur adipiscing\nelit, sed do eiusmod tempor incididunt ut labore\net dolore magna aliqua. Ut enim ad minim veniam,\nquis nostrud exercitation ullamco laboris nisi ut\naliquip ex ea commodo consequat.\n```\n\n## Example\n\n```bash\ndeno run https://deno.land/x/word_wrap/example.ts\n```\n\n## Options\n\n![image](./options.png)\n\n### options.width\n\nType: `Number`\n\nDefault: `50`\n\nThe width of the text before wrapping to a new line.\n\n**Example:**\n\n```ts\nwrap(str, { width: 60 });\n```\n\n### options.indent\n\nType: `String`\n\nDefault: `\"\"` (none)\n\nThe string to use at the beginning of each line.\n\n**Example:**\n\n```ts\nwrap(str, { indent: \"      \" });\n```\n\n### options.newline\n\nType: `String`\n\nDefault: `\\n`\n\nThe string to use at the end of each line.\n\n**Example:**\n\n```ts\nwrap(str, { newline: \"\\n\\n\" });\n```\n\n### options.escape\n\nType: `function`\n\nDefault: `function(str){return str;}`\n\nAn escape function to run on each line after splitting them.\n\n**Example:**\n\n```ts\nwrap(str, {\n  escape: function (str: string): string {\n    return str.toUpperCase();\n  },\n});\n```\n\n### options.trim\n\nType: `Boolean`\n\nDefault: `false`\n\nTrim trailing whitespace from the returned string. This option is included since\n`.trim()` would also strip the leading indentation from the first line.\n\n**Example:**\n\n```ts\nwrap(str, { trim: true });\n```\n\n### options.cut\n\nType: `Boolean`\n\nDefault: `false`\n\nBreak a word between any two letters when the word is longer than the specified\nwidth.\n\n**Example:**\n\n```ts\nwrap(str, { cut: true });\n```\n\n## License\n\n[deno_word_wrap](https://github.com/justjavac/deno_word_wrap) is released under\nthe MIT License. See the bundled [LICENSE](./LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno_word_wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustjavac%2Fdeno_word_wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustjavac%2Fdeno_word_wrap/lists"}