With data from the console
-i, --stdin: Specifies that the input is coming from the console. This option is required only when the –Source argument is omitted.-r, --parser: Defines the parser to use when the source data is provided through the console. Accepted values areyaml,jsonorxml. This option is required only when the--sourceargument is omitted or if the extension of the source file is not recognized to determine the parser.
CMD:
type "data.json" | didot --stdin -t template.hbs -r json -o output.txt
PowerShell:
Get-Content data.json | didot --stdin -t template.hbs -r json -o output.txt
Bash:
cat data.json | didot --stdin -t template.hbs -r json -o output.txt
In this example:
template.hbsis the Handlebars template file.jsonis the parser of input data.- the output is redirected to the console.
With content rendered on the console
Simply omit the -o option and the output will be rendered on the console.
PowerShell:
didot --stdin -t template.hbs -r json