{"id":16644202,"url":"https://github.com/75lb/wordwrapjs","last_synced_at":"2025-05-16T15:08:22.679Z","repository":{"id":47682960,"uuid":"41451158","full_name":"75lb/wordwrapjs","owner":"75lb","description":"Word-wrapping for javascript.","archived":false,"fork":false,"pushed_at":"2024-11-16T12:46:44.000Z","size":268,"stargazers_count":161,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T14:16:56.195Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/75lb.png","metadata":{"files":{"readme":"README.hbs","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-08-26T21:37:53.000Z","updated_at":"2025-01-20T21:29:56.000Z","dependencies_parsed_at":"2024-06-18T13:46:29.479Z","dependency_job_id":"d779a962-ad8f-4b9e-8232-ff679681b216","html_url":"https://github.com/75lb/wordwrapjs","commit_stats":{"total_commits":75,"total_committers":3,"mean_commits":25.0,"dds":"0.17333333333333334","last_synced_commit":"a56f25b228eb7bece43a8174d5574fde4bb353ff"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fwordwrapjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fwordwrapjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fwordwrapjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/75lb%2Fwordwrapjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/75lb","download_url":"https://codeload.github.com/75lb/wordwrapjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364262,"owners_count":22058877,"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":[],"created_at":"2024-10-12T08:10:46.577Z","updated_at":"2025-05-16T15:08:17.658Z","avatar_url":"https://github.com/75lb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![view on npm](https://badgen.net/npm/v/wordwrapjs)](https://www.npmjs.org/package/wordwrapjs)\n[![npm module downloads](https://badgen.net/npm/dt/wordwrapjs)](https://www.npmjs.org/package/wordwrapjs)\n[![Gihub repo dependents](https://badgen.net/github/dependents-repo/75lb/wordwrapjs)](https://github.com/75lb/wordwrapjs/network/dependents?dependent_type=REPOSITORY)\n[![Gihub package dependents](https://badgen.net/github/dependents-pkg/75lb/wordwrapjs)](https://github.com/75lb/wordwrapjs/network/dependents?dependent_type=PACKAGE)\n[![Node.js CI](https://github.com/75lb/wordwrapjs/actions/workflows/node.js.yml/badge.svg)](https://github.com/75lb/wordwrapjs/actions/workflows/node.js.yml)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/feross/standard)\n\n# wordwrapjs\n\nWord wrapping for plain text.\n\n## Synopsis\n\nWrap some text in a 20 character column.\n\n```js\nimport wordwrap from 'wordwrapjs'\n\nconst text = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'\nconst result = wordwrap.wrap(text, { width: 20 })\n```\n\n`result` now looks like this:\n```\nLorem ipsum dolor\nsit amet,\nconsectetur\nadipiscing elit, sed\ndo eiusmod tempor\nincididunt ut labore\net dolore magna\naliqua.\n```\n\nForce long words to wrap by setting the `break` flag.\n\n```\nWelcome to Node.js v16.6.2.\n\u003e wrap = require('wordwrapjs')\n\n\u003e url = 'https://github.com/75lb/wordwrapjs'\n\u003e wrap.lines(url, { width: 18 })\n[ 'https://github.com/75lb/wordwrapjs' ]\n\n\u003e wrap.lines(url, { width: 18, break: true })\n[ 'https://github.com', '/75lb/wordwrapjs' ]\n```\n\n## Load anywhere\n\nThis library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.\n\nNode.js:\n\n```js\nconst wordwrap = require('wordwrapjs')\n```\n\nWithin Node.js with ECMAScript Module support enabled:\n\n```js\nimport wordwrap from 'wordwrapjs'\n```\n\nWithin an modern browser ECMAScript Module:\n\n```js\nimport wordwrap from './node_modules/wordwrapjs/dist/index.mjs'\n```\n\nOld browser (adds `window.wordwrapjs`):\n\n```html\n\u003cscript nomodule src=\"./node_modules/wordwrapjs/dist/index.js\"\u003e\u003c/script\u003e\n```\n\n## API Reference\n\n{{#module name=\"wordwrapjs\"}}\n{{\u003ebody~}}\n{{\u003emember-index~}}\n{{\u003emembers~}}\n{{/module}}\n\n* * *\n\n\u0026copy; 2015-25 Lloyd Brookes \\\u003copensource@75lb.com\\\u003e. Documented by [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fwordwrapjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F75lb%2Fwordwrapjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F75lb%2Fwordwrapjs/lists"}