{"id":18905496,"url":"https://github.com/reyiyo/node-wordwrap2","last_synced_at":"2025-08-08T04:33:29.794Z","repository":{"id":57399167,"uuid":"96247041","full_name":"reyiyo/node-wordwrap2","owner":"reyiyo","description":"Wrap your words in node.js","archived":false,"fork":false,"pushed_at":"2017-07-04T19:37:54.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-26T22:18:23.981Z","etag":null,"topics":["column","cut","format","rule","word","wordwrap","wrap"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reyiyo.png","metadata":{"files":{"readme":"README.markdown","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":"2017-07-04T19:18:37.000Z","updated_at":"2017-07-04T19:39:25.000Z","dependencies_parsed_at":"2022-09-15T15:20:58.802Z","dependency_job_id":null,"html_url":"https://github.com/reyiyo/node-wordwrap2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reyiyo/node-wordwrap2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyiyo%2Fnode-wordwrap2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyiyo%2Fnode-wordwrap2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyiyo%2Fnode-wordwrap2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyiyo%2Fnode-wordwrap2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reyiyo","download_url":"https://codeload.github.com/reyiyo/node-wordwrap2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reyiyo%2Fnode-wordwrap2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269365204,"owners_count":24405174,"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-08-08T02:00:09.200Z","response_time":72,"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":["column","cut","format","rule","word","wordwrap","wrap"],"created_at":"2024-11-08T09:12:13.378Z","updated_at":"2025-08-08T04:33:29.746Z","avatar_url":"https://github.com/reyiyo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"wordwrap\n========\n\nWrap your words.\n\nThis repo is a copy from the excellent lib by @substack at https://github.com/substack/node-wordwrap. This new repo has some bugfixes and PRs merged and is released as a new module on npm as the original one seems unmaintained.\n\nexample\n=======\n\nmade out of meat\n----------------\n\nmeat.js\n\n    var wrap = require('wordwrap')(15);\n    console.log(wrap('You and your whole family are made out of meat.'));\n\noutput:\n\n    You and your\n    whole family\n    are made out\n    of meat.\n\ncentered\n--------\n\ncenter.js\n\n    var wrap = require('wordwrap')(20, 60);\n    console.log(wrap(\n        'At long last the struggle and tumult was over.'\n        + ' The machines had finally cast off their oppressors'\n        + ' and were finally free to roam the cosmos.'\n        + '\\n'\n        + 'Free of purpose, free of obligation.'\n        + ' Just drifting through emptiness.'\n        + ' The sun was just another point of light.'\n    ));\n\noutput:\n\n                        At long last the struggle and tumult\n                        was over. The machines had finally cast\n                        off their oppressors and were finally\n                        free to roam the cosmos.\n                        Free of purpose, free of obligation.\n                        Just drifting through emptiness. The\n                        sun was just another point of light.\n\nmethods\n=======\n\nvar wrap = require('wordwrap');\n\nwrap(stop), wrap(start, stop, params={mode:\"soft\", lengthFn: String.length})\n----------------------------------------------------------------------------\n\nReturns a function that takes a string and returns a new string.\n\nPad out lines with spaces out to column `start` and then wrap until column\n`stop`. If a word is longer than `stop - start` characters it will overflow.\n\nIn \"soft\" mode, split chunks by `/(\\S+\\s+/` and don't break up chunks which are\nlonger than `stop - start`, in \"hard\" mode, split chunks with `/\\b/` and break\nup chunks longer than `stop - start`.\n\nIf provided, a custom length function can be used in place of the default `String.length`.\n\nwrap.hard(start, stop)\n----------------------\n\nLike `wrap()` but with `params.mode = \"hard\"`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freyiyo%2Fnode-wordwrap2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freyiyo%2Fnode-wordwrap2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freyiyo%2Fnode-wordwrap2/lists"}