# samba-client

> wrapper for smbclient

Latest version **7.2.0** (published 2023-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install samba-client
pnpm add samba-client
yarn add samba-client
bun add samba-client
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.2.0 |
| Published | 2023-04-15 |
| First published | 2014-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 56 |
| Author | eFlex Systems |
| Maintainers | eflex, jakesjews, rrglomsk, nevans54 |
| Keywords | samba, smb, cifs, smbclient |

## Links

- npm: https://www.npmjs.com/package/samba-client
- Repository: https://github.com/eflexsystems/node-samba-client
- Issues: https://github.com/eflexsystems/node-samba-client/issues
- npm.io page: https://npm.io/package/samba-client

## Dependencies (1)

- [execa](https://npm.io/package/execa.md) ^5.1.1

## Recent versions

- 7.2.0 (latest) — 2023-04-15
- 7.1.2 — 2023-03-14
- 6.0.0 — 2022-10-27
- 5.0.2 — 2022-02-21
- 5.0.1 — 2022-02-10
- 5.0.0 — 2022-02-09
- 4.0.0 — 2021-02-09
- 3.4.0 — 2021-01-25
- 3.3.0 — 2020-12-07
- 3.2.0 — 2020-02-18
- 3.1.1 — 2020-02-14
- 3.1.0 — 2020-02-14
- 3.0.0 — 2019-10-23
- 2.1.0 — 2018-07-31
- 2.0.0 — 2016-10-24
- … 13 more at https://npm.io/package/samba-client/versions

## README

# node-samba-client

Node.js wrapper for smbclient

## Requirements

Requires Node.js 10+
Smbclient must be installed. This can be installed on Ubuntu with `sudo apt-get install smbclient`.

## API

```javascript
const SambaClient = require('samba-client');

let client = new SambaClient({
  address: '//server/folder', // required
  username: 'test', // not required, defaults to guest
  password: 'test', // not required
  domain: 'WORKGROUP', // not required
  maxProtocol: 'SMB3', // not required
  maskCmd: true, // not required, defaults to false
});

// send a file
await client.sendFile('somePath/file', 'destinationFolder/name');

// get a file
await client.getFile('someRemotePath/file', 'destinationFolder/name');

// create a folder
await client.mkdir('folder/tree', (optional) 'current/working/directory');
// By default CWD is __dirname

// executes dir command in remote directory
await client.dir('remote/folder', (optional) 'current/working/directory');
// By default CWD is __dirname

// validate if file or folder exists in the remote device
await client.fileExists('remote/file', (optional) 'current/working/directory');
// By default CWD is __dirname
```

## Troubleshooting

### Error: spawn ENOTDIR in Electron

Pass an empty string in the Current Working Directory parameter, for more information see [this PR](https://github.com/eflexsystems/node-samba-client/pull/20).

---
_Source: https://npm.io/package/samba-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
