Give every workspace a README describing what it does, its entry points, and a short usage example, and link them from the root package table. Frame Tailshare in the root README as the application the libraries exist to be composed into, with the other apps as development and testing surfaces. Its own README records what works today and what the open issues intend for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1.7 KiB
@webnet/smb2
SMB2/3 client built on @webnet/transport and @webnet/vfs. There is no server.
SMB2Client implements AsyncVFS (stat, readdir, statAndReaddir, readFile/readFileRange, writeFile, mkdir, delete, move, copy, setProps) over a single share. It dials through a RawDialer, negotiates the highest of SMB 2.0.2, 2.1.0, or 3.1.1 that the server supports, and authenticates with NTLM wrapped in SPNEGO via Credentials (username/password/optional domain/spn). SMB2Client also implements StateTransferable<SMB2TransferState> from @webnet/state-transfer, so an established connection's state (dialect, session, tree, signing key) can be serialized and later resumed with SMB2Client.adopt — the transferred state carries no credentials, so SMB2AdoptOptions supplies them again for reconnect fallback. Errors surface as Smb2Error.
_internals entry points are unstable and are not part of the public API.
Usage
import { SMB2Client } from "@webnet/smb2"
import type { RawDialer } from "@webnet/transport"
declare const dialer: RawDialer
const client = new SMB2Client({
dialer,
host: "example.com",
share: "shared",
username: "u",
password: "p",
})
await client.connect()
const entries = await client.readdir("/")
const stream = await client.readFile("/file.txt")
await client.disconnect()
See also
@webnet/vfs— theAsyncVFSinterface this package implements@webnet/transport— theRawDialerprimitive this package dials through@webnet/state-transfer— theStateTransferableinterface this package implements for connection handoff