Answer by Philippe for Jq how update an object in json
As jq does not have in-place editing, you need to use a temporary file to update package.json:tmp="$(mktemp)"jq '.scripts += {"prettier": "prettier --fix","eslint": "eslint run --all","foo": "bar"}'...
View ArticleAnswer by pmf for Jq how update an object in json
As bash is tagged, here's a solution using process substitution and heredoc:jq '.scripts += input' package.json <(cat << EOF{"prettier": "prettier --fix","eslint": "eslint run --all","foo":...
View ArticleJq how update an object in json
I have a file in Web development call package.json in this file there is a scripts object with some commands I would like to be able to add automatically some new commands inside "script":{} using...
View Article
More Pages to Explore .....