ftp-reader
Advanced tools
Comparing version 0.0.3 to 0.0.5
import { FtpConfigInterface } from './interfaces/FtpConfigInterface'; | ||
import { LoggerInterface } from './interfaces/LoggerInterface'; | ||
export declare function readFromFtp(ftpConfig: FtpConfigInterface, logger: LoggerInterface, filter: Function, grouper: Function, sorter: Function, processor: Function, ftpBasePath: string): Promise<void>; | ||
export declare function readFromFtp(ftpConfig: FtpConfigInterface, logger: LoggerInterface, filter: Function, grouper: Function, sorter: Function, processor: (sftpClient: any, fileGroup: any) => void, ftpBasePath: string): Promise<void>; | ||
export { getFtpFile } from './services/getFtpFile'; | ||
export { moveFtpFile } from './services/moveFtpFile'; | ||
export { deleteFtpFile } from './services/deleteFtpFile'; |
@@ -14,4 +14,2 @@ "use strict"; | ||
const getSftpConnection_1 = require("./services/getSftpConnection"); | ||
const getFtpFile_1 = require("./services/getFtpFile"); | ||
const moveFtpFile_1 = require("./services/moveFtpFile"); | ||
function getSftpFiles(sftpClient, basePath, filter, grouper, sorter) { | ||
@@ -28,3 +26,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
processor(sftpClient, getFtpFile_1.getFtpFile, moveFtpFile_1.moveFtpFile, fileGroup); | ||
processor(sftpClient, fileGroup); | ||
} | ||
@@ -47,2 +45,8 @@ catch (error) { | ||
exports.readFromFtp = readFromFtp; | ||
var getFtpFile_1 = require("./services/getFtpFile"); | ||
exports.getFtpFile = getFtpFile_1.getFtpFile; | ||
var moveFtpFile_1 = require("./services/moveFtpFile"); | ||
exports.moveFtpFile = moveFtpFile_1.moveFtpFile; | ||
var deleteFtpFile_1 = require("./services/deleteFtpFile"); | ||
exports.deleteFtpFile = deleteFtpFile_1.deleteFtpFile; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "ftp-reader", | ||
"version": "0.0.3", | ||
"version": "0.0.5", | ||
"description": "Used to process files from s/ftp servers", | ||
@@ -9,2 +9,3 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"buildPublish": "tsc && npm publish", | ||
"build-watch": "tsc -w", | ||
@@ -11,0 +12,0 @@ "lint": "eslint ./src/" |
# FTP Reader | ||
### WARNING: THIS IS UNFINISHED AND MAY NOT FULLY WORK AT THIS TIME. | ||
This module is designed to allow you to read files from an (S)FTP server easily | ||
@@ -4,0 +6,0 @@ providing some functions to filter, sort, group and process the files found. |
@@ -15,5 +15,5 @@ import {each} from 'bluebird'; | ||
async function processFile(sftpClient, fileGroup, processor: Function) { | ||
async function processFile(sftpClient, processor: Function, fileGroup) { | ||
try { | ||
processor(sftpClient, fileGroup); | ||
await processor(sftpClient, fileGroup); | ||
} | ||
@@ -39,3 +39,3 @@ catch (error) { | ||
await each(fileGroupsList, processFile.bind(null, processor)); | ||
await each(fileGroupsList, processFile.bind(null, sftpClient, processor)); | ||
@@ -42,0 +42,0 @@ sftpClient.end(); |
Sorry, the diff of this file is not supported yet
20882
36
335
22