
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
nestjs-basic-ftp
Advanced tools
npm install nestjs-basic-ftp
Originally forked but recast from https://github.com/AbdessalemLetaief/nestjs-ftp package
And extend the library https://github.com/patrickjuchli/basic-ftp
This is an FTP client for NestJs, it supports FTPS over TLS, Passive Mode over IPv6, has a Promise-based API, and offers methods to operate on whole directories built on top of basic-ftp.
Nestjs-basic-ftp is build using the NestJs Dynamic modules and Factory providers approach, to configure it import the FtpModule
module and the forRootFtpAsync
service.
For example, your AppModule
should look like this :
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config'
import { FtpModule } from 'nestjs-basic-ftp';
@Module({
imports: [
ConfigModule,
FtpModule.forRootFtpAsync({
useFactory: async (config: ConfigService) => {
return {
host: config.get<string>('FTP_URL'),
port: config.get<number>('FTP_PORT'),
user: config.get<string>('FTP_USER'),
password: config.get<string>('FTP_PASS'),
secure: config.get<boolean>('FTP_SECURE'),
verbose: true, // example, may not be declared
availableListCommands: ['LIST -a', 'LIST'], // example, may not be declared
};
},
imports: [ConfigModule],
inject: [ConfigService],
}),
],
providers: [],
controllers: [],
})
export class AppModule {}
Then just inject the service just like any local service
For Example:
import { Injectable, ServiceUnavailableException, Logger } from '@nestjs/common';
import { FtpService } from 'nestjs-basic-ftp';
@Injectable()
export class AppService {
private logger = new Logger('AppService', { timestamp: true });
constructor(private readonly _ftpService: FtpService){}
public async listingFile(): Promise<FileInfo[]> {
try {
const fileList = await this._ftpService.list();
return fileList;
} catch (e) {
this.logger.error(JSON.stringify(e));
throw new ServiceUnavailableException(e);
}
}
}
Licensed under the MIT License - see the LICENSE file for details.
FAQs
Simple 'basic-ftp' wrapper for NestJs
The npm package nestjs-basic-ftp receives a total of 111 weekly downloads. As such, nestjs-basic-ftp popularity was classified as not popular.
We found that nestjs-basic-ftp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.