skip to Main Content

Json – How to generate the following string?

Consider the following a snippet from my package.json "dependencies": { "@types/lodash.camelcase": "^4.3.6", "@types/lodash.kebabcase": "^4.1.6", "@types/lodash.lowercase": "^4.3.6", "@types/lodash.upperfirst": "^4.3.6", "@types/mime": "^2.0.3", "@types/swagger-jsdoc": "^6.0.1", "async": "^3.2.2", "aws-arn": "^1.0.1", } From this, I want to generate the following string - @types/lodash.camelcase@^4.3.6 @types/lodash.kebabcase@^4.1.6 @types/lodash.lowercase@^4.3.6…

VIEW QUESTION

Json – Whole word matches in jq

Running the below: $ echo '["lorem", "ipsum", "dolor"]' | jq '. | contains(["rem"])' returns true because "rem" is a substring of "lorem". I would like a whole word match, which would disqualify "rem" and only allow one of the three…

VIEW QUESTION

Convert json to Markdown Table in bash

I am trying to convert the below json to a markdown table(GitHub docs(.md file)), however not able to do so. { "service_1":"abc-endpoint.vpce.amazonaws.com", "service_2":"def-endpoint.vpce.amazonaws.com", "service_3":"xyz-endpoint.vpce.amazonaws.com" } Command I tried: cat json_file | jq -r '{"NAME": "ENDPOINT_ID"} + . | to_entries[] |…

VIEW QUESTION
Back To Top
Search