{"_id":"@ayoda/smb2","_rev":"5-439bf1e444f427d9dc766d851b2f13df","name":"@ayoda/smb2","description":"SMB2 Client","dist-tags":{"latest":"0.7.4"},"versions":{"0.7.3":{"name":"@ayoda/smb2","description":"SMB2 Client","homepage":"https://github.com/AyodaGmbH/node-smb2","version":"0.7.3","engines":["node"],"author":{"name":"Benjamin Chelli","email":"benjamin@chelli.net","url":"https://github.com/bchelli"},"contributors":[{"name":"Fabrice Marsaud","email":"fabrice.marsaud@vates.fr","url":"https://github.com/marsaud"},{"name":"Victor Savu","email":"vsavu@ayoda.net","url":"https://github.com/victorsavu3"}],"main":"lib/smb2.js","repository":{"type":"git","url":"git+https://github.com/AyodaGmbH/node-smb2.git"},"dependencies":{"babel-runtime":"^5.8.34","bluebird":"^2.10.2","ntlm":"~0.1.1"},"keywords":["SMB","SMB2","SMB3","NTLM","CIFS","Samba"],"scripts":{"build":"babel --source-maps --out-dir=lib/api/ lib/api/src","prepublish":"npm run build"},"devDependencies":{"babel":"^5.8.34","babel-eslint":"^4.1.6","source-map-support":"^0.4.0","standard":"^5.4.1"},"standard":{"parser":"babel-eslint"},"license":"MIT","bugs":{"url":"https://github.com/AyodaGmbH/node-smb2/issues"},"_id":"@ayoda/smb2@0.7.3","_shasum":"12535ec9a1534680d8ed21d0966a6f51fac95370","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"ayoda","email":"info@ayoda.net"},"dist":{"shasum":"12535ec9a1534680d8ed21d0966a6f51fac95370","tarball":"https://registry.npmjs.org/@ayoda/smb2/-/smb2-0.7.3.tgz","integrity":"sha512-NV646Z0jQU1z0LRZNJ4TBwhUDYl1vSN+AMemu0HsOtBQo06O96PwZpSHl8CJPBIWAwunQETGAdZXisB5woikPg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhP6El4k1E46+YOCLt5QBOoLXFH1CE4zLjYws8bysPhAIgHibUuPOZTndZ/HhRgFZqr6ImURS8ECFtubAJrGJx2Vw="}]},"maintainers":[{"name":"ayoda","email":"info@ayoda.net"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/smb2-0.7.3.tgz_1490878137436_0.043113462161272764"}},"0.7.4":{"name":"@ayoda/smb2","description":"SMB2 Client","homepage":"https://github.com/AyodaGmbH/node-smb2","version":"0.7.4","engines":["node"],"author":{"name":"Benjamin Chelli","email":"benjamin@chelli.net","url":"https://github.com/bchelli"},"contributors":[{"name":"Fabrice Marsaud","email":"fabrice.marsaud@vates.fr","url":"https://github.com/marsaud"},{"name":"Victor Savu","email":"vsavu@ayoda.net","url":"https://github.com/victorsavu3"}],"main":"lib/smb2.js","repository":{"type":"git","url":"git+https://github.com/AyodaGmbH/node-smb2.git"},"dependencies":{"babel-runtime":"^5.8.34","bluebird":"^2.10.2","ntlm":"~0.1.1"},"keywords":["SMB","SMB2","SMB3","NTLM","CIFS","Samba"],"scripts":{"build":"babel --source-maps --out-dir=lib/api/ lib/api/src","prepublish":"npm run build"},"devDependencies":{"babel":"^5.8.34","babel-eslint":"^4.1.6","source-map-support":"^0.4.0","standard":"^5.4.1"},"standard":{"parser":"babel-eslint"},"license":"MIT","gitHead":"d004b58d3865b11b8c4dee63676838fcedb1344c","bugs":{"url":"https://github.com/AyodaGmbH/node-smb2/issues"},"_id":"@ayoda/smb2@0.7.4","_shasum":"1e48466a475101417e4ef24d35567d36c05143ec","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.3","_npmUser":{"name":"ayoda","email":"info@ayoda.net"},"dist":{"shasum":"1e48466a475101417e4ef24d35567d36c05143ec","tarball":"https://registry.npmjs.org/@ayoda/smb2/-/smb2-0.7.4.tgz","integrity":"sha512-riwHhprhqIb+CXkYcns2nXVQIZ/af0UYp+zfjiNnhvS88InBB/GMZzorkgjnqLZmzEjiywXMnnk5OseTR7AmUQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGljqQQZu1Nj8cnTqFHg50eEv9gYvocBR1IVA3XMIoQ9AiEA3wr1NvC7DIMdX8Zjg3R+0+uz5iPG2w7VVyIjUXB7Ct0="}]},"maintainers":[{"name":"ayoda","email":"info@ayoda.net"},{"name":"victorsavu3","email":"victorsavu3@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/smb2-0.7.4.tgz_1509016772319_0.43852075352333486"}}},"readme":"# SMB2 Client for Node.js\n\n[![NPM version](https://badge.fury.io/js/smb2.svg)](http://badge.fury.io/js/smb2) [![Dependency Status](https://david-dm.org/bchelli/node-smb2.svg?theme=shields.io)](https://david-dm.org/bchelli/node-smb2) [![Code Climate](https://codeclimate.com/github/bchelli/node-smb2.svg)](https://codeclimate.com/github/bchelli/node-smb2)\n\n## Introduction\n\nThis library is a simple implementation of SMB2 for Node.js. It allows you to access a SMB2 share as if you were using the native fs library.\n\nThe development is still at an experimental stage and should not be yet considered for production environment.\n\n## Installation\n\n```bash\nnpm install -S @marsaud/smb2\n```\n\n## API\n\n### var smb2Client = new SMB2 ( options )\nThe SMB2 class is the constructor of your SMB2 client.\n\nthe parameter ```options``` accepts this list of attributes:\n\n- ```share``` (mandatory): the share you want to access\n- ```domain``` (mandatory): the domain of which the user is registred\n- ```username``` (mandatory): the username of the user that access the share\n- ```password``` (mandatory): the password\n- ```port``` (optional): default ```445```, the port of the SMB server\n- ```packetConcurrency``` (optional): default ```20```, the number of simulatanous packet when writting / reading data from the share\n- ```autoCloseTimeout``` (optional): default ```10000```, the timeout in milliseconds before to close the SMB2 session and the socket, if setted to ```0``` the connection will never be closed unless you do it \n\nExample:\n```javascript\n// load the library\nvar SMB2 = require('smb2');\n\n// create an SMB2 instance\nvar smb2Client = new SMB2({\n  share:'\\\\\\\\000.000.000.000\\\\c$'\n, domain:'DOMAIN'\n, username:'username'\n, password:'password!'\n});\n```\n\n### smb2Client.readdir ( path, callback )\nAsynchronous readdir(3). Reads the contents of a directory. The callback gets two arguments (err, files) where files is an array of the names of the files in the directory excluding '.' and '..'.\n\nExample:\n```javascript\nsmb2Client.readdir('Windows\\\\System32', function(err, files){\n    if(err) throw err;\n    console.log(files);\n});\n```\n\n### smb2Client.readFile ( filename, [options], callback )\n- ```filename``` String\n- ```options``` Object\n    - ```encoding``` String | Null default = null\n- ```callback``` Function\n\nAsynchronously reads the entire contents of a file. Example:\n```javascript\nsmb2Client.readFile('path\\\\to\\\\my\\\\file.txt', function(err, data){\n    if(err) throw err;\n    console.log(data);\n});\n```\nThe callback is passed two arguments (err, data), where data is the contents of the file.\n\nIf no encoding is specified, then the raw buffer is returned.\n\n### smb2Client.writeFile ( filename, data, [options], callback )\n- ```filename``` String\n- ```data``` String | Buffer\n- ```options``` Object\n    - ```encoding``` String | Null default = 'utf8'\n- ```callback``` Function\n\nAsynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer.\n\nThe encoding option is ignored if data is a buffer. It defaults to 'utf8'.\n\nExample:\n```javascript\nsmb2Client.writeFile('path\\\\to\\\\my\\\\file.txt', 'Hello Node', function (err) {\n    if (err) throw err;\n    console.log('It\\'s saved!');\n});\n```\n\n### smb2Client.mkdir ( path, [mode], callback )\nAsynchronous mkdir(2). No arguments other than a possible exception are given to the completion callback. mode defaults to 0777.\n\nExample:\n```javascript\nsmb2Client.mkdir('path\\\\to\\\\the\\\\folder', function (err) {\n    if (err) throw err;\n    console.log('Folder created!');\n});\n```\n\n### smb2Client.rmdir ( path, callback )\nAsynchronous rmdir(2). No arguments other than a possible exception are given to the completion callback.\n\nExample:\n```javascript\nsmb2Client.rmdir('path\\\\to\\\\the\\\\folder', function (err) {\n    if (err) throw err;\n    console.log('Folder deleted!');\n});\n```\n\n### smb2Client.exists ( path, callback )\nTest whether or not the given path exists by checking with the file system. Then call the callback argument with either true or false. Example:\n```javascript\nsmb2Client.exists('path\\\\to\\\\my\\\\file.txt', function (err, exists) {\n    if (err) throw err;\n    console.log(exists ? \"it's there\" : \"it's not there!\");\n});\n```\n\n### smb2Client.unlink ( path, callback )\nAsynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.\n```javascript\nsmb2Client.unlink('path\\\\to\\\\my\\\\file.txt', function (err) {\n    if (err) throw err;\n    console.log(\"file has been deleted\");\n});\n```\n\n### smb2Client.rename ( oldPath, newPath, callback )\nAsynchronous rename(2). No arguments other than a possible exception are given to the completion callback.\n```javascript\nsmb2Client.rename('path\\\\to\\\\my\\\\file.txt', 'new\\\\path\\\\to\\\\my\\\\new-file-name.txt', function (err) {\n    if (err) throw err;\n    console.log(\"file has been renamed\");\n});\n```\n\n### smb2Client.close ( )\nThis function will close the open connection if opened, it will be called automatically after ```autoCloseTimeout``` ms of no SMB2 call on the server.\n\n### smb2Client.createReadStream ( fileName, [options], callback )\nReturns a read stream on the file. Unlike fs.createReadStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.\n\nExample:\n```javascript\nsmb2Client.createReadStream('path\\\\to\\\\the\\\\file', function (err, readStream) {\n    if (err) throw err;\n    var writeStream = fs.createWriteStream('localFile')\n    readStream.pipe(writeStream)\n});\n```\n\n### smb2Client.createWriteStream ( fileName, [options], callback )\nReturns a write stream on the file. Unlike fs.createWriteStream, this function is asynchronous, as we need use asynchronous smb requests to get the stream.\n\nExample:\n```javascript\nsmb2Client.createWriteStream('path\\\\to\\\\the\\\\file', function (err, readStream) {\n    if (err) throw err;\n    var readStream = fs.createReadStream('localFile')\n    readStream.pipe(writeStream)\n});\n```\n### smb2Client.ensureDir ( path, callback )\nEnsures that the directory exists. If the directory structure does not exist, it is created.\n\n## Contributors\n- [Benjamin Chelli](https://github.com/bchelli)\n- [Fabrice Marsaud](https://github.com/marsaud)\n\n## References\n\n    The[MS-SMB2]: Server Message Block (SMB) Protocol Versions 2 and 3\n    Copyright (C) 2014 Microsoft\n    http://msdn.microsoft.com/en-us/library/cc246482.aspx\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2013-2014 Benjamin Chelli &lt;benjamin@chelli.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","maintainers":[{"name":"ayoda","email":"info@ayoda.net"},{"name":"victorsavu3","email":"victorsavu3@gmail.com"}],"time":{"modified":"2022-06-12T15:00:06.094Z","created":"2017-03-30T12:48:59.537Z","0.7.3":"2017-03-30T12:48:59.537Z","0.7.4":"2017-10-26T11:19:33.584Z"},"homepage":"https://github.com/AyodaGmbH/node-smb2","keywords":["SMB","SMB2","SMB3","NTLM","CIFS","Samba"],"repository":{"type":"git","url":"git+https://github.com/AyodaGmbH/node-smb2.git"},"contributors":[{"name":"Fabrice Marsaud","email":"fabrice.marsaud@vates.fr","url":"https://github.com/marsaud"},{"name":"Victor Savu","email":"vsavu@ayoda.net","url":"https://github.com/victorsavu3"}],"author":{"name":"Benjamin Chelli","email":"benjamin@chelli.net","url":"https://github.com/bchelli"},"bugs":{"url":"https://github.com/AyodaGmbH/node-smb2/issues"},"license":"MIT","readmeFilename":"README.md"}