Skip to content

Commit

Permalink
Add support for parsing stdin as lines of text
Browse files Browse the repository at this point in the history
  • Loading branch information
voidvoxel committed May 19, 2024
1 parent 8d9d3e1 commit 493b733
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/zerda.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,13 @@ async function main () {
async inputString => {
inputString = inputString.trim();

let input = JSON.parse(inputString);
let input;

try {
input = JSON.parse(inputString);
} catch {
input = inputString;
}

if (typeof input[0] === 'undefined') {
input = [ input ];
Expand Down

0 comments on commit 493b733

Please sign in to comment.