ssh2-sftp-client
Advanced tools
Comparing version 2.2.1 to 3.0.0
{ | ||
"name": "ssh2-sftp-client", | ||
"version": "2.2.1", | ||
"version": "3.0.0", | ||
"description": "ssh2 sftp client for node", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -57,4 +57,6 @@ ## SSH2 SFTP Client | ||
#### Get | ||
get a new readable stream for path. The encoding is passed to Node Stream (https://nodejs.org/api/stream.html) and it controls how the content is encoded. For example, when downloading binary data, 'null' should be passed (check node stream documentation). Default to 'utf8'. | ||
Get a Chunk from remotePath. The encoding is passed to Node Stream (https://nodejs.org/api/stream.html) and it controls how the content is encoded. For example, when downloading binary data, 'null' should be passed (check node stream documentation). Default to 'utf8'. | ||
> Before V3.0.0, `get` method will return new readable stream from remotePath. | ||
```javascript | ||
@@ -147,2 +149,5 @@ sftp.get(remoteFilePath, [useCompression], [encoding], [addtionalOptions]); | ||
### Log | ||
#### V3.0.0 | ||
- change: `sftp.get` will return chunk not stream anymore | ||
- fix: get readable not emitting data events in node 10.0.0 | ||
@@ -149,0 +154,0 @@ #### V2.1.1 |
@@ -76,4 +76,9 @@ /** | ||
}); | ||
// after V10.0.0, 'readable' takes precedence in controlling the flow, | ||
// i.e. 'data' will be emitted only when stream.read() is called | ||
stream.on('readable', () => { | ||
resolve(stream); | ||
let chunk; | ||
while((chunk = stream.read()) !== null) { | ||
resolve(chunk) | ||
} | ||
}); | ||
@@ -80,0 +85,0 @@ } catch(err) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173
18350
7
424
3