diff options
author | Rich Trott <rtrott@gmail.com> | 2017-08-16 07:00:34 -0700 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-09-05 12:49:53 -0400 |
commit | c5adb5f0083d47317fb6cf1dbd9b6873738e01f7 (patch) | |
tree | 7c51778b607f8f7c7b7cbb0750d88a19ab149a09 /tools/eslint/node_modules/markdown-table/Readme.md | |
parent | 688e5ed6fd9aee2ecab576282dfd131db0a4711e (diff) | |
download | node-new-c5adb5f0083d47317fb6cf1dbd9b6873738e01f7.tar.gz |
tools: update ESLint to 4.2.0
ESLint 4.2.0 contains a fix for a bug that is blocking us from moving to
the non-legacy stricter indentation linting. Update to 4.2.0 to remove
the blocking issue.
Backport-PR-URL: https://github.com/nodejs/node/pull/14859
PR-URL: https://github.com/nodejs/node/pull/14155
Ref: https://github.com/eslint/eslint/issues/8882
Ref: https://github.com/eslint/eslint/pull/8885
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'tools/eslint/node_modules/markdown-table/Readme.md')
-rw-r--r-- | tools/eslint/node_modules/markdown-table/Readme.md | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/markdown-table/Readme.md b/tools/eslint/node_modules/markdown-table/Readme.md new file mode 100644 index 0000000000..9931cc11d2 --- /dev/null +++ b/tools/eslint/node_modules/markdown-table/Readme.md @@ -0,0 +1,132 @@ +# markdown-table [![Build Status](https://img.shields.io/travis/wooorm/markdown-table.svg?style=flat)](https://travis-ci.org/wooorm/markdown-table) [![Coverage Status](https://img.shields.io/coveralls/wooorm/markdown-table.svg?style=flat)](https://coveralls.io/r/wooorm/markdown-table?branch=master) + +Generate fancy [Markdown](https://help.github.com/articles/github-flavored-markdown/#tables)/ASCII tables. + +## Installation + +[npm](https://docs.npmjs.com/cli/install): + +```bash +$ npm install markdown-table +``` + +[Component.js](https://github.com/componentjs/component): + +```bash +$ component install wooorm/markdown-table +``` + +[Bower](http://bower.io/#install-packages): + +```bash +$ bower install markdown-table +``` + +[Duo](http://duojs.org/#getting-started): + +```javascript +var table = require('wooorm/markdown-table'); +``` + +## Usage + +```javascript +var table = require('markdown-table'); + +/** + * Normal usage (defaults to left-alignment): + */ + +table([ + ['Branch', 'Commit'], + ['master', '0123456789abcdef'], + ['staging', 'fedcba9876543210'] +]); +/* + * | Branch | Commit | + * | ------- | ---------------- | + * | master | 0123456789abcdef | + * | staging | fedcba9876543210 | + */ + +/** + * With alignment: + */ + +table([ + ['Beep', 'No.', 'Boop'], + ['beep', '1024', 'xyz'], + ['boop', '3388450', 'tuv'], + ['foo', '10106', 'qrstuv'], + ['bar', '45', 'lmno'] +], { + 'align': ['l', 'c', 'r'] +}); +/* + * | Beep | No. | Boop | + * | :--- | :-----: | -----: | + * | beep | 1024 | xyz | + * | boop | 3388450 | tuv | + * | foo | 10106 | qrstuv | + * | bar | 45 | lmno | + */ + +/** + * Alignment on dots: + */ + +table([ + ['No.'], + ['0.1.2'], + ['11.22.33'], + ['5.6.'], + ['1.22222'], +], { + 'align': '.' +}); +/* + * | No. | + * | :---------: | + * | 0.1.2 | + * | 11.22.33 | + * | 5.6. | + * | 1.22222 | + */ +``` + +## API + +### markdownTable(table, options?) + +Turns a given matrix of strings (an array of arrays of strings) into a table. + +The following options are available: + +- `options.align` — String or array of strings, the strings being either `"l"` (left), `"r"` (right), `c` (center), or `.` (dot). Other values are treated as `""`, which doesn’t place the colon but does left align. _Only the lowercased first character is used, so `Right` is fine_; +- `options.delimiter` — Value to insert between cells. Carefull, non-pipe values will break GitHub Flavored Markdown; +- `options.start` — Value to insert at the beginning of every row. +- `options.end` — Value to insert at the end of every row. +- `options.rule` — Whether to display a rule between the header and the body of the table. Carefull, will break GitHub Flavored Markdown when `false`; +- `options.stringLength` — The method to detect the length of a cell (see below). + +### options.stringLength(cell) + +ANSI-sequences mess up tables on terminals. To fix this, you have to pass in a `stringLength` option to detect the “visible” length of a cell. + +```javascript +var chalk = require('chalk'); + +function stringLength(cell) { + return chalk.stripColor(cell).length; +} +``` + +See the [tests for an example](test.js#L368-L375). + +## Inspiration + +The original idea and basic implementation was inspired by James Halliday's [text-table](https://github.com/substack/text-table) library. + +## License + +[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) |