{"name":"wide-align","version":"1.0.0","description":"A wide-character aware text alignment function for use on the console or with fixed width fonts.","main":"align.js","scripts":{"test":"tap --coverage test/*.js"},"keywords":["wide","double","unicode","cjkv","pad","align"],"author":{"name":"Rebecca Turner","email":"me@re-becca.org","url":"http://re-becca.org/"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/iarna/wide-align.git"},"dependencies":{"string-width":"^1.0.1"},"devDependencies":{"tap":"^2.3.2"},"gitHead":"195beaf9ffddacc074a179ddb7750382914152d5","bugs":{"url":"https://github.com/iarna/wide-align/issues"},"homepage":"https://github.com/iarna/wide-align#readme","_id":"wide-align@1.0.0","_shasum":"1f106589d579da0c79ea3d76f3ee5c399116d0b0","_from":".","_npmVersion":"3.5.2","_nodeVersion":"4.2.2","_npmUser":{"name":"iarna","email":"me@re-becca.org"},"dist":{"shasum":"1f106589d579da0c79ea3d76f3ee5c399116d0b0","tarball":"http://registry-npm.ywwl.com/wide-align/download/wide-align-1.0.0.tgz","integrity":"sha512-tXiTonk4+7Gm79R/Ft+IX7P3DleFfsL2YxdPzfNGY8nC5nGBAOi08rX8wWLOoz/UKOo/Hwio5dBtxyfeBHu1iw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwIWxT4pEFnBAGcMtOHuDAPW+y+V4t3EMPSCKB9c49cAiAtb9RhvdsVe1sMh39m0DiVxF1gI/rTVmo+fp0gfB0xCA=="}],"size":2282,"noattachment":false,"key":"/wide-align/-/wide-align-1.0.0.tgz"},"maintainers":[{"name":"iarna","email":"me@re-becca.org"}],"directories":{},"readme":"wide-align\n----------\n\nA wide-character aware text alignment function for use in terminals / on the\nconsole.\n\n### Usage\n\n```\nvar align = require('wide-align')\n\n// Note that if you view this on a unicode console, all of the slashes are\n// aligned. This is because on a console, all narrow characters are\n// an en wide and all wide characters are an em. In browsers, this isn't\n// held to and wide characters like \"古\" can be less than two narrow\n// characters even with a fixed width font.\n\nconsole.log(align.center('abc', 10))     // '   abc    '\nconsole.log(align.center('古古古', 10))  // '  古古古  '\nconsole.log(align.left('abc', 10))       // 'abc       '\nconsole.log(align.left('古古古', 10))    // '古古古    '\nconsole.log(align.right('abc', 10))      // '       abc'\nconsole.log(align.right('古古古', 10))   // '    古古古'\n```\n\n### Functions\n\n#### `align.center(str, length)` → `str`\n\nReturns *str* with spaces added to both sides such that that it is *length*\nchars long and centered in the spaces.\n\n#### `align.left(str, length)` → `str`\n\nReturns *str* with spaces to the right such that it is *length* chars long.\n\n### `align.right(str, length)` → `str`\n\nReturns *str* with spaces to the left such that it is *length* chars long.\n\n### Origins\n\nThese functions were originally taken from \n[cliui](https://npmjs.com/package/cliui). Changes include switching to the\nMUCH faster pad generation function from\n[lodash](https://npmjs.com/package/lodash), making center alignment pad\nboth sides and adding left alignment.\n","publish_time":1450245483765,"_cnpm_publish_time":1450245483765,"dist-tags":{"latest":"1.1.5"}}