Narwhals Poke Mammals

    gfm-table

    0.1.0 • Public • Published

    gfm-table

    gfm-table generates GFM (GitHub Flavored Markdown) style table.

    Installation

    $ npm install gfm-table
    

    Usage

    var table = require('gfm-table')
     
    var out = table([
      ['name', 'color', 'count'],
      ['Manx Loaghtan', 'brown', 1200],
      ['Merino', 'white', 534],
      ['Suffolk', 'black', 200]
    ]);
     
    console.log(out);

    Output

    | name          | color | count |
    | ------------- | ----- | ----- |
    | Manx Loaghtan | brown | 1200  |
    | Merino        | white | 534   |
    | Suffolk       | black | 200   |
    

    With alignment options

    • l - left
    • c - center
    • r - right
    var table = require('gfm-table')
     
    var out = table([
      ['name', 'color', 'count'],
      ['Manx Loaghtan', 'brown', 1200],
      ['Merino', 'white', 534],
      ['Suffolk', 'black', 200]
    ], ['c', 'l', 'r']);
     
    console.log(out);

    Output

    |     name      | color | count |
    |:-------------:|:----- | -----:|
    | Manx Loaghtan | brown |  1200 |
    |    Merino     | white |   534 |
    |    Suffolk    | black |   200 |
    

    License

    MIT

    Install

    npm i gfm-table

    DownloadsWeekly Downloads

    19

    Version

    0.1.0

    License

    MIT

    Last publish

    Collaborators

    • hitsujiwool