This seems like an exact copy of https://github.com/strongloop/loopback-clients/pull/6/files#diff-21. Is there a way how to share/reuse the code?