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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-smb-server

v0.10.36

Published

A Pure JavaScript SMB Server Implementation

Downloads

193

Readme

SMB Server for Node.js

Overwiew

node-smb-server is an open-source JavaScript implementation of the SMB/CIFS file sharing protocol.

Some highlights:

  • pure JavaScript
  • fully configurable/customizable
  • extensible: allows to expose non-filesystem based data as a mountable file system via an abstract backend SPI (similar to Samba's VFS)

Installation

npm install node-smb-server

or

git clone https://github.com/adobe/node-smb-server.git
cd node-smb-server
npm install

Getting started

Execute the following commands in a terminal:

cd <node-smb-server install dir>
npm start

In Finder, open the 'Connect to Server' dialog (⌘K) and enter the url smb://localhost:8445/fs (user: test, password: test).

Getting your hands dirty

User management

The following users are pre-configured: test/test, admin/admin, guest/<empty password>

Users can be edited in the config.json file:

...
"users" : {
    "test" : {
      "lmHash" : "01fc5a6be7bc6929aad3b435b51404ee",
      "ntlmHash" : "0cb6948805f797bf2a82807973b89537"
    },
    "admin" : {
      "lmHash" : "f0d412bd764ffe81aad3b435b51404ee",
      "ntlmHash" : "209c6174da490caeb422f3fa5a7ae634"
    },
    "guest" : {
      "lmHash" : "aad3b435b51404eeaad3b435b51404ee",
      "ntlmHash" : "31d6cfe0d16ae931b73c59d7e0c089c0"
    }
  }
...

Password hashes can be computed by running:

node createhash.js

Share configuration

Share configurations can be edited in the config.json file, e.g.:

...
 "shares": {
    "FS": {
      "backend": "fs",
      "description": "fs-based test share",
      "path": "./smbroot"
    },
    "JCR": {
      "backend": "jcr",
      "description": "AEM-based test share",
      "host": "localhost",
      "port": 4502,
      "protocol": "http:",
      "auth": {
        "user": "<user>",
        "pass": "<pwd>"
      },
      "path": "/",
      "maxSockets": 64,
      "contentCacheTTL": 30000,
      "binCacheTTL": 600000
    },
...

Developing a custom backend

Consider the following example use case:

You would like to enable your desktop applications to access data and documents stored in a RDBMS or a Cloud-based service.

You could write a custom backend by implementing the Share, Tree and File interfaces of the virtual backend SPI (lib/spi). Check out the existing implementations (lib/backends) to get an idea.

Current Status

  • Implements CIFS and MS-SMB 1.0.
  • Support for SMB2 is currently work in progress.
  • Supports LM, LMv2, NTLM, NTLMSSP authentication protocols
  • Supported backends:
    • local file system (lib/backends/fs)
    • JCR (lib/backends/jcr)
    • AEM Assets (lib/backends/dam)
  • Tested with Finder on OS X (Yosemite, El Capitan, Sierra).

ToDo's

  • Test with other clients on other platforms (Windows, Linux).
  • Test cases/suite

CIFS/SMB:

  • missing NT_TRANSACT subcommands
  • missing TRANSACTION subcommands
  • missing TRANSACTION2 subcommand information levels
  • missing CIFS commands:
    • TRANSACTION_SECONDARY
    • TRANSACTION2_SECONDARY
    • NT_TRANSACT_SECONDARY
    • OPEN_PRINT_FILE
  • support for named streams?
  • SMB Signing?
  • proper implementation of LOCKING_ANDX?

Check/Implement the following protocol extensions/versions:

  • SMB2/3