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

@ln-maf/sftp

v4.1.7

Published

SFTP step definitions for MAF

Readme

MAF - SFTP Module

This module provides SFTP step definitions for testing file servers, enabling automated testing of file transfers and server operations.

npm package GitHub Actions [![Dependencies][dep-image]][dep-url]

Dependencies

This module is dependent on the following npm modules:

  • ssh2-sftp-client

Setup

  1. Install by running npm i @ln-maf/sftp

  2. Add a new step file in the features folder with the following code:

require('@ln-maf/sftp')

Configuration

The SFTP module uses connection configuration that can be provided through:

  • Environment variables (SSH_AUTH_SOCK for agent authentication)
  • Global MAF variables stored in this.results:
    • host or hostname: The SFTP server hostname
    • port: The SFTP server port
    • username: The username for authentication
    • password: The password for authentication

Note: Username and host are required for SFTP operations.

Step Definitions

When list of files from remote server directory {string} is received

Retrieves a list of files from the specified remote server directory.

Parameters:

  • serverDirectory (string): The path to the remote directory

Returns: Array of filenames found in the directory

Example:

When list of files from remote server directory "/uploads" is received

When file {string} is downloaded from server as file {string}

Downloads a specific file from the remote server to a local location.

Parameters:

  • serverFile (string): The full path to the file on the remote server
  • file (string): The local filename where the file will be saved

Returns: The local file path where the file was downloaded

Example:

When file "/uploads/data.txt" is downloaded from server as file "downloaded_data.txt"

When latest file from server directory {string} is downloaded as file {string}

Downloads the most recently modified file from the specified remote directory.

Parameters:

  • remoteDirectory (string): The path to the remote directory
  • file (string): The local filename where the file will be saved

Returns: The name of the file that was downloaded

Example:

When latest file from server directory "/uploads" is downloaded as file "latest_upload.txt"

When file {string} is put in server folder {string}

Uploads a local file to the specified remote server directory.

Parameters:

  • file (string): The local filename to upload
  • serverDirectory (string): The remote directory path where the file will be placed

Returns: The remote file path where the file was uploaded

Example:

When file "test_data.txt" is put in server folder "/uploads/"

Global MAF Variables

The SFTP module integrates with MAF's global variable system and supports template literals:

  • host/hostname: SFTP server address
  • port: SFTP server port (optional)
  • username: Authentication username (required)
  • password: Authentication password (required)