I was recently looking over the promisify-node code to see how the author was able to convert basic functions and objects to a promised-based API. I quickly realized that they were reading function signatures to look for common callback argument names like `callback` and `cb`.
Full article