Gathering detailed insights and metrics for nest-sftp
Gathering detailed insights and metrics for nest-sftp
Gathering detailed insights and metrics for nest-sftp
Gathering detailed insights and metrics for nest-sftp
npm install nest-sftp
Typescript
Module System
Node Version
NPM Version
TypeScript (96.64%)
JavaScript (3.36%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
17 Stars
130 Commits
16 Forks
2 Watchers
2 Branches
2 Contributors
Updated on May 08, 2025
Latest Version
3.0.0
Package Id
nest-sftp@3.0.0
Unpacked Size
147.86 kB
Size
73.91 kB
File Count
23
NPM Version
10.4.0
Node Version
20.11.0
Published on
Feb 27, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
33
This is nest-sftp.
Nest framework module wrapper around ssh2-sftp-client
1$ npm install --save nest-sftp
Register the SftpModule in you App Module.
This version uses forRootAsync
1import { SftpModule } from 'nest-sftp'; 2 3@Module({ 4 imports: [ 5 SftpModule.forRootAsync( 6 { 7 useFactory: (configService: ConfigService) => { 8 return configService.getSftpConnectionInfo(); 9 }, 10 inject: [ConfigService], 11 imports: [AppModule], 12 }, 13 false, 14 ), 15 ], 16 controllers: [], 17 providers: [ConfigService], 18 exports: [ConfigService], 19}) 20export class AppModule {}
The Options object implements the ConnectConfig from ssh2.
1import { SftpModule } from 'nest-sftp'; 2 3@Module({ 4 imports: [ 5 SftpModule.forRoot( 6 { 7 host: 'fakehost.com', 8 port: 22, 9 username: 'fakeUser', 10 password: '*****', // passwords should not contain \ (thy should be espaced like \\) and they cannot contain ! or ( 11 }, 12 false, 13 ), 14 ], 15 controllers: [], 16 providers: [], 17}) 18export class AppModule {}
With debug logging:
1import { SftpModule } from 'nest-sftp'; 2 3@Module({ 4 imports: [ 5 SftpModule.forRoot( 6 { 7 host: 'fakehost.com', 8 port: 22, 9 username: 'fakeUser', 10 password: '*****', // passwords should not contain \ (thy should be espaced like \\) and they cannot contain ! or ( 11 debug: console.log, // adds logging for researching problems 12 }, 13 false, 14 ), 15 ], 16 controllers: [], 17 providers: [], 18}) 19export class AppModule {}
The SftpModule is global. The forRoot() method will open the connection as well during AppModule registration. Then the SftpClientService can be injected into your class.
1import { SftpClientService } from 'nest-sftp'; 2 3export class AppService { 4 private readonly logger: Logger; 5 constructor(private readonly sftpClient: SftpClientService) { 6 logger = new Logger(); 7 } 8 9 async download( 10 remotePath: string, 11 localPath: string, 12 ): Promise<string | NodeJS.ReadableStream | Buffer> { 13 return await this.sftpClient.download(remotePath, localPath); 14 } 15 // change connection to a different user/password prior to upload 16 async submit( 17 remotePath: string, 18 localPath: string, 19 submitConfig: ConnectConfig, 20 ): Promise<string | NodeJS.ReadableStream | Buffer> { 21 await this.sftpClient.resetConnection(submitConfig); 22 return await this.sftpClient.upload(remotePath, localPath); 23 } 24}
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
Nest SFTP is MIT licensed.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
15 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More