Commit 972486e2 authored by Fabrice Marsaud's avatar Fabrice Marsaud

doc and package config

parent b88b6e24
......@@ -142,6 +142,30 @@ smb2Client.rename('path\\to\\my\\file.txt', 'new\\path\\to\\my\\new-file-name.tx
### smb2Client.close ( )
This function will close the open connection if opened, it will be called automatically after ```autoCloseTimeout``` ms of no SMB2 call on the server.
### smb2Client.createReadStream ( fileName, [options], callback )
Returns a read stream on the file. Unlike fs.createReadStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.
Example:
```javascript
smb2Client.createReadStream('path\\to\\the\\file', function (err, readStream) {
if (err) throw err;
var writeStream = fs.createWriteStream('localFile')
readStream.pipe(writeStream)
});
```
### smb2Client.createWtiteStream ( fileName, [options], callback )
Returns a write stream on the file. Unlike fs.createWriteStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.
Example:
```javascript
smb2Client.createWriteStream('path\\to\\the\\file', function (err, readStream) {
if (err) throw err;
var readStream = fs.createReadStream('localFile')
readStream.pipe(writeStream)
});
```
## References
The[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3
......
{
"name": "smb2",
"name": "@marsaud/smb2",
"description": "SMB2 Client",
"homepage": "https://github.com/bchelli/node-smb2",
"homepage": "https://github.com/marsaud/node-smb2",
"version": "0.2.6",
"engines": [
"node"
......@@ -11,10 +11,13 @@
"email": "benjamin@chelli.net",
"url": "https://github.com/bchelli"
},
"contributors": [
"Fabrice Marsaud <fabrice.marsaud@vates.fr> (https://github.com/marsaud)"
],
"main": "lib/smb2.js",
"repository": {
"type": "git",
"url": "https://github.com/bchelli/node-smb2"
"url": "https://github.com/marsaud/node-smb2"
},
"dependencies": {
"ntlm": "~0.1.1"
......@@ -28,7 +31,8 @@
"Samba"
],
"scripts": {
"build": "./node_modules/.bin/babel --source-maps --out-dir=lib/api/ lib/api/src"
"build": "./node_modules/.bin/babel --source-maps --out-dir=lib/api/ lib/api/src",
"prepublish": "npm run build"
},
"devDependencies": {
"babel": "^5.8.34",
......@@ -37,5 +41,6 @@
},
"standard": {
"parser": "babel-eslint"
}
},
"license": "MIT"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment