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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fs-tunnel

v1.0.0

Published

Modern SSH/SFTP file system client for Node.js - provides seamless remote file operations with a clean Promise-based API. Supports secure file transfers, directory management, and streaming for large files.

Readme

SSH/SFTP File System Client

NPM Version Publish Size Downloads License: MIT

Modern SSH/SFTP client for Node.js

A robust TypeScript library providing seamless file system operations over SSH/SFTP with a clean, promise-based API. Perfect for secure file transfers, remote server management, and automation tasks.

Table of Contents

Installation

npm install fs-tunnel

Usage

Basic example

import { SSHFileSystem } from 'fs-tunnel'

const config = {
  host: 'example.com',
  port: 22,
  username: 'user',
  password: 'password'
}

async function main() {
  const fs = new SSHFileSystem(config)
  
  try {
    await fs.connect()
    
    // List files in directory
    const files = await fs.readdir('/remote/path')
    console.log('Directory contents:', files)
    
    // Get file stats
    const stats = await fs.stat('/remote/file.txt')
    console.log('File stats:', stats)
    
    // Download file
    const readStream = fs.createReadStream('/remote/file.txt')
    readStream.pipe(fs.createWriteStream('./local-file.txt'))
    
  } finally {
    fs.disconnect()
  }
}

main()

Advanced example

// Upload directory recursively
async function uploadDirectory(localPath, remotePath) {
  const items = await fs.promises.readdir(localPath, { withFileTypes: true })
  
  await fs.mkdir(remotePath)
  
  for (const item of items) {
    const localItemPath = path.join(localPath, item.name)
    const remoteItemPath = path.posix.join(remotePath, item.name)
    
    if (item.isDirectory()) {
      await uploadDirectory(localItemPath, remoteItemPath)
    } else {
      const readStream = fs.createReadStream(localItemPath)
      const writeStream = fs.createWriteStream(remoteItemPath)
      readStream.pipe(writeStream)
    }
  }
}

API Reference

Class: SSHFileSystem

Constructor

new SSHFileSystem(config: SSHConfiguration)
  • config: Connection configuration object
    • host: Server hostname (required)
    • port: SSH port (required)
    • username: Authentication username
    • password: Authentication password

Methods

| Method | Description | |--------|-------------| | connect() | Connects using configured credentials | | connectWithCredentials(username, password) | Connects with explicit credentials | | readdir(path) | Lists directory contents | | stat(path) | Gets file/directory stats | | mkdir(path) | Creates a directory | | rmdir(path) | Removes a directory | | unlink(path) | Deletes a file | | rename(oldPath, newPath) | Renames/moves a file | | createReadStream(path) | Creates readable file stream | | createWriteStream(path, options) | Creates writable file stream | | disconnect() | Closes the connection |

Interfaces

FileInfo

{
  name: string
  isDirectory: boolean
  size: number
  mtime: Date
  mode: number
}

StatInfo

{
  isDirectory: boolean
  size: number
  mtime: Date
  mode: number
}

SSHConfiguration

{
  host: string
  port: number
  username?: string
  password?: string
}

Contributing

Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.

License

fs-tunnel is licensed under the MIT license.

Author

|@SheikhAminul| |:---:| |@SheikhAminul|