0.3.6 • Published 4 months ago

ts-sftp-server v0.3.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

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";

2) 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);
    },
  },
});

3) Implement the following events

EventDescription
ConnectionAllow/Refuse connection
AuthUser authentication
RENAMERename a file/folder inside the server
REMOVERemove file from the server
SETSTATChange file properties
WRITEWrite changes to a file
READRead file content
OPENDIRClient request to open a certain directory
RMDIRClient request to remove a certain directory
MKDIRClient request to create a certain directory
READDIRClient request to read list of a directory's contents alongside that content's permissions
CLOSEClient closing pointer to a certain file/directory
REALPATHTell client information related to a path
LSTAT,STAT,FSTATTell client information related to a file/directory

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

Funding

FundingDescription
MACbioIDi2Promoting the cohesion of Macaronesian regions through a common ICT platform for biomedical R & D & i (INTERREG program MAC2/1.1b/352)
NeuroRehabLabThe 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.
ARDITIThe 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.
0.3.6

4 months ago

0.3.5

4 months ago

0.3.4

4 months ago

0.3.3

4 months ago

0.3.0

7 months ago

0.3.2

7 months ago

0.3.1

7 months ago

0.2.6

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.3

11 months ago

0.2.2

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago