{"id":21331174,"url":"https://github.com/netbeast/freeboard","last_synced_at":"2025-09-01T12:13:05.365Z","repository":{"id":147464387,"uuid":"59286388","full_name":"netbeast/freeboard","owner":"netbeast","description":"Netbeast app that serves a freeboard instance thanks to http://freeboard.io/","archived":false,"fork":false,"pushed_at":"2016-05-24T09:39:22.000Z","size":3845,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T00:42:04.905Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/netbeast.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-20T10:35:54.000Z","updated_at":"2021-03-04T10:34:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"24d3d77f-e8be-48ad-925a-2b468875e20a","html_url":"https://github.com/netbeast/freeboard","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/netbeast/freeboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Ffreeboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Ffreeboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Ffreeboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Ffreeboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netbeast","download_url":"https://codeload.github.com/netbeast/freeboard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netbeast%2Ffreeboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273122129,"owners_count":25049539,"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-09-01T02:00:09.058Z","response_time":120,"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":[],"created_at":"2024-11-21T22:29:47.309Z","updated_at":"2025-09-01T12:13:05.354Z","avatar_url":"https://github.com/netbeast.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# align-text [![NPM version](https://badge.fury.io/js/align-text.svg)](http://badge.fury.io/js/align-text)  [![Build Status](https://travis-ci.org/jonschlinkert/align-text.svg)](https://travis-ci.org/jonschlinkert/align-text)\n\n\u003e Align the text in a string.\n\n**Examples**\n\nAlign text values in an array:\n\n```js\nalign([1, 2, 3, 100]);\n//=\u003e ['  1', '  2', '  3', '100']\n```\n\nOr [do stuff like this](./example.js):\n\n[![screen shot 2015-06-09 at 2 08 34 am](https://cloud.githubusercontent.com/assets/383994/8051597/7b716fbc-0e4c-11e5-9aef-4493fd22db58.png)](./example.js)\n\nVisit [the example](./example.js) to see how this works.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/)\n\n```sh\n$ npm i align-text --save\n```\n\n## Usage\n\n```js\nvar align = require('align-text');\nalign(text, callback_function_or_integer);\n```\n\n**Params**\n\n* `text` can be a **string or array**. If a string is passed, a string will be returned. If an array is passed, an array will be returned.\n* `callback|integer`: if an integer, the text will be indented by that amount. If a function, it must return an integer representing the amount of leading indentation to use as `align` loops over each line.\n\n**Example**\n\n```js\nalign(text, 4);\n```\n\nWould align:\n\n```\nabc\nabc\nabc\n```\n\nTo:\n\n```\n    abc\n    abc\n    abc\n```\n\n## callback\n\n### params\n\nThe callback is used to determine the indentation of each line and gets the following params:\n\n* `len` the length of the \"current\" line\n* `longest` the length of the longest line\n* `line` the current line (string) being aligned\n* `lines` the array of all lines\n\n### return\n\nThe callback may return:\n\n* an integer that represents the number of spaces to use for padding,\n* or an object with the following properties:\n  - `indent`: **{Number}** the amount of indentation to use. Default is `0` when an object is returned.\n  - `character`: **{String}** the character to use for indentation. Default is `''` (empty string) when an object is returned.\n  - `prefix`: **{String}** leading characters to use at the beginning of each line. `''` (empty string) when an object is returned.\n\n**Integer example:**\n\n```js\n// calculate half the difference between the length\n// of the current line and the longest line\nfunction centerAlign(len, longest, line, lines) {\n  return Math.floor((longest - len) / 2);\n}\n```\n\n**Object example:**\n\n```js\nfunction centerAlign(len, longest, line, lines) {\n  return {\n    character: '\\t',\n    indent: Math.floor((longest - len) / 2),\n    prefix: '~ ',\n  }\n}\n```\n\n## Usage examples\n\n### Center align\n\nUsing the `centerAlign` function from above:\n\n```js\nalign(text, centerAlign);\n```\n\nWould align this text:\n\n```js\nLorem ipsum dolor sit amet\nconsectetur adipiscin\nelit, sed do eiusmod tempor incididun\nut labore et dolor\nmagna aliqua. Ut enim ad mini\nveniam, quis\n```\n\nResulting in this:\n\n```\n     Lorem ipsum dolor sit amet,\n        consectetur adipiscing\nelit, sed do eiusmod tempor incididunt\n         ut labore et dolore\n    magna aliqua. Ut enim ad minim\n             veniam, quis\n```\n\n**Customize**\n\nIf you wanted to add more padding on the left, just pass the number in the callback.\n\nFor example, to add 4 spaces before every line:\n\n```js\nfunction centerAlign(len, longest, line, lines) {\n  return 4 + Math.floor((longest - len) / 2);\n}\n```\n\nWould result in:\n\n```\n         Lorem ipsum dolor sit amet,\n            consectetur adipiscing\n    elit, sed do eiusmod tempor incididunt\n             ut labore et dolore\n        magna aliqua. Ut enim ad minim\n                 veniam, quis\n```\n\n### Bullets\n\n```js\nalign(text, function (len, max, line, lines) {\n  return {prefix: ' - '};\n});\n```\n\nWould return:\n\n```\n- Lorem ipsum dolor sit amet,\n- consectetur adipiscing\n- elit, sed do eiusmod tempor incididunt\n- ut labore et dolore\n- magna aliqua. Ut enim ad minim\n- veniam, quis\n```\n\n### Different indent character\n\n```js\nalign(text, function (len, max, line, lines) {\n  return { \n    indent: Math.floor((max - len) / 2), \n    character: '~', \n  };\n});\n```\n\nWould return\n\n```\n~~~~~Lorem ipsum dolor sit amet,\n~~~~~~~~consectetur adipiscing\nelit, sed do eiusmod tempor incididunt\n~~~~~~~~~ut labore et dolore\n~~~~magna aliqua. Ut enim ad minim\n~~~~~~~~~~~~~veniam, quis\n```\n\n## Related projects\n\n* [center-align](https://github.com/jonschlinkert/center-align): Center-align the text in a string.\n* [justify](https://github.com/bahamas10/node-justify): Left or right (or both) justify text using a custom width and character\n* [longest](https://github.com/jonschlinkert/longest): Get the longest item in an array.\n* [right-align](https://github.com/jonschlinkert/right-align): Right-align the text in a string.\n* [repeat-string](https://github.com/jonschlinkert/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string.\n* [word-wrap](https://github.com/jonschlinkert/word-wrap): Wrap words to a specified length.\n\n## Running tests\n\nInstall dev dependencies:\n\n```sh\n$ npm i -d \u0026\u0026 npm test\n```\n\n## Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/align-text/issues/new)\n\n## Author\n\n**Jon Schlinkert**\n\n+ [github/jonschlinkert](https://github.com/jonschlinkert)\n+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)\n\n## License\n\nCopyright © 2015 [Jon Schlinkert](https://github.com/jonschlinkert)\nReleased under the MIT license.\n\n***\n\n_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 09, 2015._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbeast%2Ffreeboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetbeast%2Ffreeboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetbeast%2Ffreeboard/lists"}