0

So far I got this: https://img.shields.io/badge/dynamic/json?url=https://raw.githubusercontent.com/axios/axios/master/package.json&query=$.dependencies[*]&label=dependecies

Maybe there is a way to convert object to array and then use .length?

Or maybe third party api which ether has dependencies in array or has number of dependencies

If it's not clear in case of axios which has 1 dependency I want to have this badge:

enter image description here

gregsdennis
  • 7,218
  • 3
  • 38
  • 71
henroper
  • 127
  • 3
  • 9

1 Answers1

0

Unfortunately, this is not supported by JSONPath (yet). The .length() function can only be used to count items in an array, see the relevant docs section here. In your case, you are trying to count items in an object.

length() Provides the length of an array

alfredodeza
  • 5,058
  • 4
  • 35
  • 44