README
SMB2 Client for Node.js
Introduction
This library is a simple implementation of marsaud-smb2 for Node.js. It allows you to access a SMB2 share as if you were using the native fs library.
The development is still at an experimental stage and should not be yet considered for production environment.
Different
add fileAttributes in readdir result Used to determine whether the file or folder ,mabe 0x0010 is folder, 0x0100 is file.
add fileSize in readdir
Installation
npm install -S smb2c
API
var smb2Client = new SMB2 ( options )
The SMB2 class is the constructor of your SMB2 client.
the parameter options
accepts this list of attributes:
share
(mandatory): the share you want to accessdomain
(mandatory): the domain of which the user is registredusername
(mandatory): the username of the user that access the sharepassword
(mandatory): the passwordport
(optional): default445
, the port of the SMB serverpacketConcurrency
(optional): default20
, the number of simulatanous packet when writting / reading data from the shareautoCloseTimeout
(optional): default10000
, the timeout in milliseconds before to close the SMB2 session and the socket, if setted to0
the connection will never be closed unless you do it
Example:
// load the library
var SMB2 = require('smb2');
// create an SMB2 instance
var smb2Client = new SMB2({
share:'\\\\000.000.000.000\\c