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 ...@@ -142,6 +142,30 @@ smb2Client.rename('path\\to\\my\\file.txt', 'new\\path\\to\\my\\new-file-name.tx
### smb2Client.close ( ) ### 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. 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 ## References
The[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3 The[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3
......
{ {
"name": "smb2", "name": "@marsaud/smb2",
"description": "SMB2 Client", "description": "SMB2 Client",
"homepage": "https://github.com/bchelli/node-smb2", "homepage": "https://github.com/marsaud/node-smb2",
"version": "0.2.6", "version": "0.2.6",
"engines": [ "engines": [
"node" "node"
...@@ -11,10 +11,13 @@ ...@@ -11,10 +11,13 @@
"email": "benjamin@chelli.net", "email": "benjamin@chelli.net",
"url": "https://github.com/bchelli" "url": "https://github.com/bchelli"
}, },
"contributors": [
"Fabrice Marsaud <fabrice.marsaud@vates.fr> (https://github.com/marsaud)"
],
"main": "lib/smb2.js", "main": "lib/smb2.js",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/bchelli/node-smb2" "url": "https://github.com/marsaud/node-smb2"
}, },
"dependencies": { "dependencies": {
"ntlm": "~0.1.1" "ntlm": "~0.1.1"
...@@ -28,7 +31,8 @@ ...@@ -28,7 +31,8 @@
"Samba" "Samba"
], ],
"scripts": { "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": { "devDependencies": {
"babel": "^5.8.34", "babel": "^5.8.34",
...@@ -37,5 +41,6 @@ ...@@ -37,5 +41,6 @@
}, },
"standard": { "standard": {
"parser": "babel-eslint" "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