Display curl output in readable JSON format in Unix shell script

Display curl output in readable JSON format in Unix shell script

curl http://localhost:8880/test.json | npx json

Source: stackoverflow.com