6.0.3 • Published 6 months ago

ftp-service v6.0.3

Weekly downloads
27
License
MIT
Repository
github
Last release
6 months ago

ftp-service

A simple wrapper for a simpler FTP client surface API with pool and retry management.

GitHub license Coverage Status

This wrapper is directly usable with Knifecycle.

API

initFTPService(services) ⇒ Promise.<FTPService>

Instantiate the FTP service

Kind: global function
Returns: Promise.<FTPService> - A promise of the FTP service

ParamTypeDescription
servicesObjectThe services to inject
services.ENVObjectAn environment object
services.FTPfunctionThe configuration object as given to basic-ftp client access method
services.FTP_CONFIGfunctionThe FTP service configuration object
services.FTP_POOLfunctionThe FTP pool configuration object as given to generic-pool.
services.FTP_TIMEOUTfunctionThe FTP service timeout as given to basic-ftp client constructor
services.FTP_PASSWORD_ENV_NAMEfunctionThe environment variable name in which to pick-up the FTP password
services.logfunctionA logging function
services.delayfunctionA service to manage delays

Example

import initFTPService from 'ftp-service';
import { initDelayService } from 'common-services';

const delay = await initDelayService({
  log: console.log.bind(console),
})
const fpt = await initFTPService({
  FTP: {
    host: 'localhost',
    user: 'user',
    pasword: 'pwd',
  },
  FTP_CONFIG: { base: '' },
  ENV: process.env,
  delay,
  log: console.log.bind(console),
});

const files = await ftp.list('/');

Authors

License

MIT

6.0.3

6 months ago

5.0.0

9 months ago

6.0.1

9 months ago

6.0.0

9 months ago

6.0.2

9 months ago

4.0.1

1 year ago

4.0.0

2 years ago

3.0.0

2 years ago

2.0.1

2 years ago

2.0.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago