@juangm/samba-client
Version:
Wrapper for smbclient
41 lines (27 loc) • 1.02 kB
Markdown
[](https://badge.fury.io/js/%40juangm%2Fsamba-client)
- **node-samba-client** is a wrapper for smbclient for linux systems to interact with **SMB/CIFS** file sharing protocol.
- Requires Node.js 10+
- Smbclient must be installed.
- This can be installed on Ubuntu with `sudo apt install smbclient`.
Just run >>> `npm install @juangm/samba-client`
```javascript
import { SambaClient } from '@juangm/samba-client'
const config: SmbConfig = {
address: '//server/folder',
domain: 'WORKGROUP',
username: 'guest',
password: 'test'
path: '...',
others: '...',
};
const client = new SambaClient(config);
// send a file
await client.sendFile('somePath/file', 'destinationFolder/name');
// get a file
await client.getFile('someRemotePath/file', 'destinationFolder/name');
```