Exit code does not match count of invalid files if there are more than 255 erroneous files. Exit code should not exceed 127 on most platforms. See https://en.wikipedia.org/wiki/Exit_status It's better to have a fixed error exit code. https://github.com/educastellano/jsonlint-tree/blob/5d4a522f8d83770c28d99e1674db9db6aab3f356/index.js#L36