v0.1.1
@push.rocks/smartsamba
A TypeScript Samba/SMB client and server module backed by a bundled Rust SMB engine.
Install
pnpm add @push.rocks/smartsamba
Usage
import { SambaServer, SambaClient } from '@push.rocks/smartsamba';
const server = new SambaServer({
port: 0,
users: [{ username: 'alice', password: 'secret' }],
shares: [{ name: 'files', path: './shared' }],
});
const started = await server.start();
const client = new SambaClient({
host: '127.0.0.1',
port: started.port,
auth: { username: 'alice', password: 'secret' },
});
await client.writeFile('files', 'hello.txt', 'hello samba');
const data = await client.readFileAsString('files', 'hello.txt');
await client.stop();
await server.stop();
The TypeScript API uses @push.rocks/smartrust to communicate with the bundled rustsamba binary built by @git.zone/tsrust. It does not wrap system smbd or smbclient.
Description
Languages
Rust
61%
TypeScript
39%