Counts the digits in a decimal number.
npm install digit-count
digit-count(1234); // returns 4
digit-count('1234'); // 4
digit-count(-1234); // 4, again
digit-count(1234.2232); // still returns 4
// but!
digit-count('abcd'); // throws a type error
Adopted from Mwr247's elegant solution to this problem, which can be found here.