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

ts-sftp-server

v0.3.6

Published

NodeJS SFTP Server using TypeScript

Downloads

56

Readme

TypeScript SFTP Server

Implement a simple SFTP Server using TypeScript and Node.js.

NOTE: This work is part of MACbioIDi2: Promoting the cohesion of Macaronesian regions through a common ICT platform for biomedical R & D & i (INTERREG program MAC2/1.1b/352).

Warning Not all FTP methods are implemented.

Based on work by @mscdex - ssh2, ssh2-streams. Inspired by the work of @validityhq - node-sftp-server and @expressjs - express.

How to use

  1. First, import the SFTP Server module
import SFTPServer from "ts-sftp-server";
  1. Instanciate the server
let sftpServer = new SFTPServer({
  port: 3000,
  privateKeyFilePath: PRIVATE_KEY_FILE_PATH,
  authMethods: ['password'],
  printMethods: {
    // Print to console on error (not mandatory to implement)
    onError: (msg: string) => {
      // console.log(msg);
    },
    // Print to console on operation success (not mandatory to implement)
    onSuccess: (msg: string) => {
      // console.log(msg);
    },
    // Print to console warnings (not mandatory to implement)
    onWarning: (msg: string) => {
      // console.log(msg);
    },
  },
});
  1. Implement the following events

|Event |Description | |---------------------|-------------------------------------------------------------------------------------------| |Connection |Allow/Refuse connection | |Auth |User authentication | |RENAME |Rename a file/folder inside the server | |REMOVE |Remove file from the server | |SETSTAT |Change file properties | |WRITE |Write changes to a file | |READ |Read file content | |OPENDIR |Client request to open a certain directory | |RMDIR |Client request to remove a certain directory | |MKDIR |Client request to create a certain directory | |READDIR |Client request to read list of a directory's contents alongside that content's permissions | |CLOSE |Client closing pointer to a certain file/directory | |REALPATH |Tell client information related to a path | |LSTAT,STAT,FSTAT |Tell client information related to a file/directory |

The example inside the folder "test" demos the implementation of an SFTP Server using TypeScript

Funding

| Funding | Description | |--|--| | MACbioIDi2 | Promoting the cohesion of Macaronesian regions through a common ICT platform for biomedical R & D & i (INTERREG program MAC2/1.1b/352) | | NeuroRehabLab | The NeuroRehabLab is an interdisciplinary research group of the University of Madeira that investigates the intersection of technology, neuroscience, and clinical practice to find novel solutions to increase the quality of life of those with special needs. We capitalize on Virtual Reality, Serious Games, and Brain-Computer Interfaces to exploit specific brain mechanisms that relate to functional recovery to approach motor and cognitive rehabilitation by means of non-invasive and low-cost technologies. | | ARDITI | The Regional Agency for the Development of Research, Technology and Innovation - ARDITI, aims to support research and experimental development activities, the promotion of technological diffusion, training and scientific and technical information, as well as actions that contribute to the modernization and development of the Autonomous Region of Madeira (RAM). This support will be in line with the Region’s economic and social development plan, in particular with a view to ensuring the sustainability of economic growth and employment in the Region. This plan promotes a new paradigm of development policies based on innovation, entrepreneurship and the knowledge society, thus guaranteeing a significant increase in the population's educational and training levels and, simultaneously, an increase in social cohesion. |