npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@winlinux/smb2

v1.1.0

Published

SMB 2 and 3 file-share client for Node.js (a fork of node-smb2): signing, encryption, share listing and pluggable authentication.

Readme

@winlinux/smb2

An SMB 2 and 3 file-share client for Node.js. It is a fork of node-smb2 (MIT, see LICENSE.node-smb2.md) with pluggable authentication, packet signing, SMB 3.x encryption and share listing.

Most users want the winlinux package, which adds WinRM, a CLI and one credential set for both.

npm install @winlinux/smb2 @winlinux/auth
import { connect } from '@winlinux/smb2';
import { createAuthProvider } from '@winlinux/auth';

const smb = await connect({
  host: 'server.corp.example',
  authProvider: createAuthProvider('ntlm'),
  credentials: { username: 'alice', password: process.env.WINLINUX_PASSWORD, domain: 'CORP' },
});
try {
  console.log(await smb.listShares());
  console.log(await smb.list('C$', 'Windows/Temp'));
  await smb.download('C$', 'Windows/Temp/report.csv', './report.csv');
  const tail = await smb.readRange('C$', 'inetpub/logs/LogFiles/W3SVC1/u_ex261011.log', 400 * 1024 * 1024, 1024 * 1024);
  const signal = AbortSignal.timeout(5000); // or an AbortController's signal
  for await (const entry of smb.listIter('C$', 'Windows/System32', { signal })) {
    if (entry.name.endsWith('.dll')) break;  // stops the listing and closes the handle
  }
} finally {
  await smb.close();
}
  • Dialects: SMB 3.1.1, 3.0.2, 3.0, 2.1 and 2.0.2. maxDialect: '2.1' limits a connection to SMB 2.x.
  • Signing: HMAC-SHA256, AES-CMAC and AES-GMAC. Encryption: AES-128-GCM and AES-128-CCM, when the server or a share requires it.
  • Kerberos signing needs the session key from the optional @winlinux/krb-session-key addon.
  • AbortSignal, and connect and request timeouts. list, listIter, stat, readFile and download take { signal } as their last argument. On abort the call sends no further request, the request in flight rejects at once, the file or directory handle closes, and the call rejects with SmbAbortError, whose name is 'AbortError'; the session stays usable. A signal that is already aborted rejects before any request goes out.
  • A download that fails or is aborted removes the partial file at its local path before it rejects, so no truncated file stays behind.
  • listIter(share, dir) yields entries as each QUERY_DIRECTORY response arrives, so a caller with a time budget can stop early: break closes the directory handle.
  • readRange(share, path, offset, length) returns the bytes [offset, offset + length) of a file of any size, for example the tail of a large log: the file opens read-only with share access read, write and delete, so a file another process holds open for append reads too. Fewer bytes come back at end of file, an empty Buffer past it; length above MAX_BUFFERED_FILE_BYTES (64 MiB) is refused.
  • No runtime dependencies. The package has no NTLM code of its own: an AuthProvider (from @winlinux/auth or your own) does the sign-in.

ESM only, Node.js 22 or later. MIT license.