Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit b27058d

Browse files
committed
Merge pull request #59 from jensvrai/high_level_events
High level api event listeners
2 parents fb088c8 + b63aac5 commit b27058d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/scp.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,11 @@ exports = module.exports = global_client;
9191

9292
exports.Client = Client;
9393

94-
exports.scp = function(src, dest, callback) {
95-
var client = new Client();
94+
exports.scp = function(src, dest, client, callback) {
95+
if (typeof client === 'function') {
96+
callback = client;
97+
client = new Client();
98+
}
9699
client.on('error', callback);
97100
var parsed = client.parse(src);
98101
if (parsed.host && parsed.path) {

0 commit comments

Comments
 (0)