{"_id":"ansi-align","_rev":"181299","name":"ansi-align","description":"align-text with ANSI support for CLIs","dist-tags":{"latest":"3.0.1"},"maintainers":[{"name":"nexdrew","email":""}],"time":{"modified":"2022-10-18T09:50:17.000Z","created":"2016-04-30T17:43:23.016Z","3.0.1":"2021-09-27T11:53:48.509Z","3.0.0":"2018-12-17T15:54:43.480Z","2.0.0":"2017-05-01T21:14:57.101Z","1.1.0":"2016-06-06T20:14:39.942Z","1.0.0":"2016-04-30T17:43:23.016Z"},"users":{},"author":{"name":"nexdrew"},"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"versions":{"3.0.1":{"name":"ansi-align","version":"3.0.1","description":"align-text with ANSI support for CLIs","main":"index.js","scripts":{"pretest":"standard","test":"nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"keywords":["ansi","align","cli","center","pad"],"author":{"name":"nexdrew"},"license":"ISC","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"homepage":"https://github.com/nexdrew/ansi-align#readme","dependencies":{"string-width":"^4.1.0"},"devDependencies":{"ava":"^2.0.0","chalk":"^2.4.2","coveralls":"^3.0.3","nyc":"^14.0.0","standard":"^14.0.0","standard-version":"^7.0.0"},"gitHead":"f79021ac88b3c36c0ccd35c640fc0a82e20f5c0d","_id":"ansi-align@3.0.1","_nodeVersion":"14.17.6","_npmVersion":"6.14.15","dist":{"shasum":"0cdf12e111ace773a86e9a1fad1225c43cb19a59","size":3243,"noattachment":false,"key":"/ansi-align/-/ansi-align-3.0.1.tgz","tarball":"http://name.csiicloud.com:7001/ansi-align/download/ansi-align-3.0.1.tgz"},"_npmUser":{"name":"nexdrew","email":"andrewbgoode@gmail.com"},"directories":{},"maintainers":[{"name":"nexdrew","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ansi-align_3.0.1_1632743628385_0.09245440725387799"},"_hasShrinkwrap":false,"publish_time":1632743628509,"_cnpm_publish_time":1632743628509,"_cnpmcore_publish_time":"2021-12-13T17:12:35.387Z"},"3.0.0":{"name":"ansi-align","version":"3.0.0","description":"align-text with ANSI support for CLIs","main":"index.js","scripts":{"pretest":"standard","test":"nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"keywords":["ansi","align","cli","center","pad"],"author":{"name":"nexdrew"},"license":"ISC","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"homepage":"https://github.com/nexdrew/ansi-align#readme","dependencies":{"string-width":"^3.0.0"},"devDependencies":{"ava":"^1.0.1","chalk":"^2.4.1","coveralls":"^3.0.2","nyc":"^13.1.0","standard":"^12.0.1","standard-version":"^4.4.0"},"gitHead":"7ed8748da479f9030d8036240638d5f8a56200a7","_id":"ansi-align@3.0.0","_npmVersion":"6.5.0","_nodeVersion":"11.4.0","_npmUser":{"name":"nexdrew","email":"andrewbgoode@gmail.com"},"dist":{"shasum":"b536b371cf687caaef236c18d3e21fe3797467cb","size":3164,"noattachment":false,"key":"/ansi-align/-/ansi-align-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/ansi-align/download/ansi-align-3.0.0.tgz"},"maintainers":[{"name":"nexdrew","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ansi-align_3.0.0_1545062083396_0.9918253175045062"},"_hasShrinkwrap":false,"publish_time":1545062083480,"_cnpm_publish_time":1545062083480},"2.0.0":{"name":"ansi-align","version":"2.0.0","description":"align-text with ANSI support for CLIs","main":"index.js","scripts":{"pretest":"standard","test":"nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"standard-version"},"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"keywords":["ansi","align","cli","center","pad"],"author":{"name":"nexdrew"},"license":"ISC","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"homepage":"https://github.com/nexdrew/ansi-align#readme","dependencies":{"string-width":"^2.0.0"},"devDependencies":{"ava":"^0.19.1","chalk":"^1.1.3","coveralls":"^2.13.1","nyc":"^10.3.0","standard":"^10.0.2","standard-version":"^4.0.0"},"gitHead":"b27d6251ee7b22c7350e4c39219283e3e0fa735e","_id":"ansi-align@2.0.0","_shasum":"c36aeccba563b89ceb556f3690f0b1d9e3547f7f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"nexdrew","email":"andrew@npmjs.com"},"dist":{"shasum":"c36aeccba563b89ceb556f3690f0b1d9e3547f7f","size":3056,"noattachment":false,"key":"/ansi-align/-/ansi-align-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/ansi-align/download/ansi-align-2.0.0.tgz"},"maintainers":[{"name":"nexdrew","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ansi-align-2.0.0.tgz_1493673296356_0.4257998722605407"},"directories":{},"publish_time":1493673297101,"_hasShrinkwrap":false,"_cnpm_publish_time":1493673297101},"1.1.0":{"name":"ansi-align","version":"1.1.0","description":"align-text with ANSI support for CLIs","main":"index.js","scripts":{"pretest":"standard","test":"nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"standard-version"},"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"keywords":["ansi","align","cli","center","pad"],"author":{"name":"nexdrew"},"license":"ISC","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"homepage":"https://github.com/nexdrew/ansi-align#readme","dependencies":{"string-width":"^1.0.1"},"devDependencies":{"ava":"^0.15.2","chalk":"^1.1.3","coveralls":"^2.11.9","nyc":"^6.4.4","standard":"^7.1.2","standard-version":"^2.3.0"},"gitHead":"839c4e214a5690d7463dda32cf76d2ac15826f7a","_id":"ansi-align@1.1.0","_shasum":"2f0c1658829739add5ebb15e6b0c6e3423f016ba","_from":".","_npmVersion":"3.8.8","_nodeVersion":"5.11.0","_npmUser":{"name":"nexdrew","email":"andrew@npmjs.com"},"dist":{"shasum":"2f0c1658829739add5ebb15e6b0c6e3423f016ba","size":2948,"noattachment":false,"key":"/ansi-align/-/ansi-align-1.1.0.tgz","tarball":"http://name.csiicloud.com:7001/ansi-align/download/ansi-align-1.1.0.tgz"},"maintainers":[{"name":"nexdrew","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ansi-align-1.1.0.tgz_1465244078324_0.3411616289522499"},"directories":{},"publish_time":1465244079942,"_cnpm_publish_time":1465244079942,"_hasShrinkwrap":false},"1.0.0":{"name":"ansi-align","version":"1.0.0","description":"align-text with ANSI support for CLIs","main":"index.js","scripts":{"pretest":"standard","test":"nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls","release":"standard-version"},"files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/nexdrew/ansi-align.git"},"keywords":["ansi","align","cli","center","pad"],"author":{"name":"nexdrew"},"license":"ISC","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"homepage":"https://github.com/nexdrew/ansi-align#readme","dependencies":{"string-width":"^1.0.1"},"devDependencies":{"ava":"^0.14.0","chalk":"^1.1.3","coveralls":"^2.11.9","nyc":"^6.4.0","standard":"^6.0.8","standard-version":"^2.1.2"},"gitHead":"cbe98690cf12574556c29031dcbbcd65b7bf1742","_id":"ansi-align@1.0.0","_shasum":"49d9b2119fc11b00447020f8e00cc57fbe873ecc","_from":".","_npmVersion":"3.8.8","_nodeVersion":"5.11.0","_npmUser":{"name":"nexdrew","email":"andrew@npmjs.com"},"dist":{"shasum":"49d9b2119fc11b00447020f8e00cc57fbe873ecc","size":2745,"noattachment":false,"key":"/ansi-align/-/ansi-align-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/ansi-align/download/ansi-align-1.0.0.tgz"},"maintainers":[{"name":"nexdrew","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ansi-align-1.0.0.tgz_1462038200263_0.3248008810915053"},"directories":{},"publish_time":1462038203016,"_cnpm_publish_time":1462038203016,"_hasShrinkwrap":false}},"readme":"# ansi-align\n\n> align-text with ANSI support for CLIs\n\n[![Build Status](https://travis-ci.org/nexdrew/ansi-align.svg?branch=master)](https://travis-ci.org/nexdrew/ansi-align)\n[![Coverage Status](https://coveralls.io/repos/github/nexdrew/ansi-align/badge.svg?branch=master)](https://coveralls.io/github/nexdrew/ansi-align?branch=master)\n[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)\n[![Greenkeeper badge](https://badges.greenkeeper.io/nexdrew/ansi-align.svg)](https://greenkeeper.io/)\n\nEasily center- or right- align a block of text, carefully ignoring ANSI escape codes.\n\nE.g. turn this:\n\n<img width=\"281\" alt=\"ansi text block no alignment :(\" src=\"https://cloud.githubusercontent.com/assets/1929625/14937509/7c3076dc-0ed7-11e6-8c16-4f6a4ccc8346.png\">\n\nInto this:\n\n<img width=\"278\" alt=\"ansi text block center aligned!\" src=\"https://cloud.githubusercontent.com/assets/1929625/14937510/7c3ca0b0-0ed7-11e6-8f0a-541ca39b6e0a.png\">\n\n## Install\n\n```sh\nnpm install --save ansi-align\n```\n\n```js\nvar ansiAlign = require('ansi-align')\n```\n\n## API\n\n### `ansiAlign(text, [opts])`\n\nAlign the given text per the line with the greatest [`string-width`](https://github.com/sindresorhus/string-width), returning a new string (or array).\n\n#### Arguments\n\n- `text`: required, string or array\n\n    The text to align. If a string is given, it will be split using either the `opts.split` value or `'\\n'` by default. If an array is given, a different array of modified strings will be returned.\n\n- `opts`: optional, object\n\n    Options to change behavior, see below.\n\n#### Options\n\n- `opts.align`: string, default `'center'`\n\n   The alignment mode. Use `'center'` for center-alignment, `'right'` for right-alignment, or `'left'` for left-alignment. Note that the given `text` is assumed to be left-aligned already, so specifying `align: 'left'` just returns the `text` as is (no-op).\n\n- `opts.split`: string or RegExp, default `'\\n'`\n\n    The separator to use when splitting the text. Only used if text is given as a string.\n\n- `opts.pad`: string, default `' '`\n\n    The value used to left-pad (prepend to) lines of lesser width. Will be repeated as necessary to adjust alignment to the line with the greatest width.\n\n### `ansiAlign.center(text)`\n\nAlias for `ansiAlign(text, { align: 'center' })`.\n\n### `ansiAlign.right(text)`\n\nAlias for `ansiAlign(text, { align: 'right' })`.\n\n### `ansiAlign.left(text)`\n\nAlias for `ansiAlign(text, { align: 'left' })`, which is a no-op.\n\n## Similar Packages\n\n- [`center-align`](https://github.com/jonschlinkert/center-align): Very close to this package, except it doesn't support ANSI codes.\n- [`left-pad`](https://github.com/camwest/left-pad): Great for left-padding but does not support center alignment or ANSI codes.\n- Pretty much anything by the [chalk](https://github.com/chalk) team\n\n## License\n\nISC © Contributors\n","_attachments":{},"homepage":"https://github.com/nexdrew/ansi-align#readme","bugs":{"url":"https://github.com/nexdrew/ansi-align/issues"},"license":"ISC"}