{"id":15653264,"url":"https://github.com/jonschlinkert/justified","last_synced_at":"2025-07-30T13:11:06.838Z","repository":{"id":17255713,"uuid":"20025206","full_name":"jonschlinkert/justified","owner":"jonschlinkert","description":"Wrap, align and justify the words in a string.","archived":false,"fork":false,"pushed_at":"2018-02-12T13:59:46.000Z","size":30,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-19T23:29:34.794Z","etag":null,"topics":["align","console","javascript","justified","justify","node","nodejs","pad","padding","prompt","repeat","string","terminal","text"],"latest_commit_sha":null,"homepage":"https://github.com/jonschlinkert","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/jonschlinkert.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":"2014-05-21T14:54:52.000Z","updated_at":"2024-10-18T12:55:28.000Z","dependencies_parsed_at":"2022-09-11T07:50:49.125Z","dependency_job_id":null,"html_url":"https://github.com/jonschlinkert/justified","commit_stats":null,"previous_names":["jonschlinkert/justify"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jonschlinkert/justified","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fjustified","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fjustified/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fjustified/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fjustified/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonschlinkert","download_url":"https://codeload.github.com/jonschlinkert/justified/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonschlinkert%2Fjustified/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267874095,"owners_count":24158757,"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-07-30T02:00:09.044Z","response_time":70,"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":["align","console","javascript","justified","justify","node","nodejs","pad","padding","prompt","repeat","string","terminal","text"],"created_at":"2024-10-03T12:45:09.885Z","updated_at":"2025-07-30T13:11:06.783Z","avatar_url":"https://github.com/jonschlinkert.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# justified [![NPM version](https://img.shields.io/npm/v/justified.svg?style=flat)](https://www.npmjs.com/package/justified) [![NPM monthly downloads](https://img.shields.io/npm/dm/justified.svg?style=flat)](https://npmjs.org/package/justified) [![NPM total downloads](https://img.shields.io/npm/dt/justified.svg?style=flat)](https://npmjs.org/package/justified) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/justified.svg?style=flat\u0026label=Travis)](https://travis-ci.org/jonschlinkert/justified)\n\n\u003e Wraps words to a specified length and justifies the text in each line.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save justified\n```\n\n## Usage\n\n```js\nvar justify = require('justified');\n\njustify('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. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');\n```\n\nResults in:\n\n```\nLorem  ipsum dolor  sit   amet, consectetur  adipiscing\nelit,  sed do eiusmod  tempor incididunt  ut  labore et\ndolore  magna  aliqua.  Ut  enim ad minim  veniam, quis\nnostrud exercitation ullamco laboris nisi ut aliquip ex\nea  commodo consequat.  Duis    aute  irure    dolor in\nreprehenderit in voluptate  velit esse cillum dolore eu\nfugiat    nulla  pariatur.    Excepteur  sint  occaecat\ncupidatat  non proident,    sunt in culpa   qui officia\ndeserunt mollit anim id est laborum.\n```\n\n## Options\n\nSee [word-wrap](https://github.com/jonschlinkert/word-wrap) for additional options beyond the following.\n\n### options.width\n\n**Type**: `number`\n\n**Default**: `55`\n\nSet the maximum width for the justified text.\n\n### options.indent\n\n**Type**: `number`\n\n**Default**: `0`\n\nAdd the specified number of spaces (left padding) before each line in the given string.\n\n### options.random\n\n**Type**: `function`\n\n**Default**: a pseudo-random function is used to provide the appearance of randomization. The purpose of this is to ensure that whitespace doesn't appear to be somewhat \"aligned\" in columns on the left or right side of the text (which is distracting to readers), whilst also making the result technically predictable so that you're not getting a different result every time you call the \"justified\" function.\n\n### options.justifyLastLine\n\n**Type**: `boolean|function`\n\n**Default**: `false`\n\nThe last line in the string is not justified by default.\n\n## About\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eContributing\u003c/strong\u003e\u003c/summary\u003e\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eRunning Tests\u003c/strong\u003e\u003c/summary\u003e\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install \u0026\u0026 npm test\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eBuilding docs\u003c/strong\u003e\u003c/summary\u003e\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme \u0026\u0026 verb\n```\n\n\u003c/details\u003e\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left \"Left pad a string with zeros or a specified string. Fastest implementation.\")\n* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right \"Right pad a string with zeros or a specified string. Fastest implementation.\")\n* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string \"Repeat the given string n times. Fastest implementation for repeating a string.\")\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 19 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 2 | [parro-it](https://github.com/parro-it) |\n\n### Author\n\n**Jon Schlinkert**\n\n* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](http://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 12, 2018._","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fjustified","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonschlinkert%2Fjustified","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonschlinkert%2Fjustified/lists"}