Stars, forks, most recent commit, number of open and closed issues, number of open and merged PRs, number of contributors... all forms a picture.
Also... quality (or in fact existence) of documentation; number of NPM downloads if it's a package; general level of community activity (hard to judge accurately - but you want to see some level of interest for basic google keywords).
If it's a big enough choice like a framework - look at developer surveys, popularity of the stack, availability of training resources... it's a bigger choice so do more background research.
But for a small library, a reasonable amount of NPM downloads and github activity is usually enough - I want to see some evidence that it's still actively maintained; and whether issues are getting resolved.