yq can be called as a module if needed. With -y/-Y, files can be edited in place like with sed -i: Because YAML treats JSON as a dialect of YAML, you can use yq to convert JSON to YAML: yq -y . < ...
This makes it easy to extract data embedded in JavaScript code using XPath in a way more robust than just using regular expressions. Use calmjs.parse instead of slimit for JavaScript parsing ...