The `filename` arg should be renamed, since the input could now be a filename or an array.