Proper way to skip a then function in Q Promises
问题 In my code, based on a specific condition, I would like to skip to the done function, irrespective of all the then functions. The original version of this question is in the edits. The following is the actual problem I am dealing with. Sorry for the inconvenience Actual Problem : I am reading a file and processing it. If the contents of the file match certain conditions, I have to do a series of operations on the file system (say read and write few files) and then to execute done function. If