for (constlineofgetUciLines()) { try { constcommand = parser.tryParse(line); if (commandinstanceofInfoCommand) { for (constattrofcommand.attributes) { if (attrinstanceofPrincipalVariationInfoAttr) { console.log(attr.moves); } } } } catch (err) { // it is usually best to ignore invalid UCI commands. } }
A Command parser.
Examples