First you have to determine what a strong and weak password is, this is already the most obvious start. There are several types of implementations, here you can see an example comparing three different passwords in several different services:
Irecommend read the full explanation here , just where have this image.
Dropbox has made available its open source password analysis system, you can see here . It has implementations in several different languages.
If you want a list with more options:
If you want a comparison, see here .
Measuring password strengths is relative, by me extremely flawed. The strength of the password will be measured by a standard, a criterion that you believe is safe. Even so there is so much difference the result of a library and another library. The problem is that the attacker may not follow his pattern. It is impossible to determine the strength of a password if the attacker's technique is unknown.
In addition, the "correcthorsebatterystaple" password may not be considered good, for example, Bruce Schneier , this is the same password that Dropbox's ZXCVBN considers safer.
Personally I believe that the most important thing is to allow the user to use 2FA, preferably FIDO U2F and for now also accept the TOTP. This will be the main factor if the person discovers the password will be barred by the second authentication.
Remember to save the password correctly (using Argon2, BCrypt, Scrypt or PBDKF2, with high difficulties), this will delay offline attacks if your database has been compromised.