Quantcast
Channel: Jq how update an object in json - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article



Answer 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 Article

Jq 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
Browsing latest articles
Browse All 3 View Live




Latest Images