1.0.5 • Published 5 years ago

permutation-markdown-table v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

permutation-markdown-table

Build Status npm version

This utility reads JSON in certain format from STDIN or a file, generates combination of values, and outputs to STDOUT or a file.

Sample Input

{
    "breakfast": ["milk", "toast", "bacon & eggs"],
    "lunch": ["sandwich", "oily Asian take-away"],
    "supper": "some microwave food",
    "snacks": ["Mars", "Oreo"],
    "budget": 9.99
}

Input Schema

  • Input should be a valid JSON in text
  • Each field should be either a scalar value or an array of scalar values

Sample Output

| breakfast    | lunch                | supper              | snacks | budget |
|--------------|----------------------|---------------------|--------|--------|
| milk         | sandwich             | some microwave food | Mars   | 9.99   |
| milk         | sandwich             | some microwave food | Oreo   | 9.99   |
| milk         | oily Asian take-away | some microwave food | Mars   | 9.99   |
| milk         | oily Asian take-away | some microwave food | Oreo   | 9.99   |
| toast        | sandwich             | some microwave food | Mars   | 9.99   |
| toast        | sandwich             | some microwave food | Oreo   | 9.99   |
| toast        | oily Asian take-away | some microwave food | Mars   | 9.99   |
| toast        | oily Asian take-away | some microwave food | Oreo   | 9.99   |
| bacon & eggs | sandwich             | some microwave food | Mars   | 9.99   |
| bacon & eggs | sandwich             | some microwave food | Oreo   | 9.99   |
| bacon & eggs | oily Asian take-away | some microwave food | Mars   | 9.99   |
| bacon & eggs | oily Asian take-away | some microwave food | Oreo   | 9.99   |

Usage

Read from STDIN and output to STDOUT

cat some.json | permutation-markdown-table

Read from file and output to STDOUT

permutation-markdown-table -i ./some.json

Output to a file

permutation-markdown-table -o ./test-case.md

Options

optiondescriptionexample
-h, —helpoutput usage information
-V, —versionoutput the version number
-i, —input path to the input file-i ./some.json
-o, —output path to the output file-o ./test-case.md

Install

For convinience, the recommended installation is via NPM.

npm install -g permutation-markdown-table
1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago