@engine9-io/input-tools 1.8.7 → 1.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ValidatingReadable.js +0 -1
- package/file/FileUtilities.js +5 -3
- package/file/S3.js +2 -1
- package/package.json +1 -1
package/ValidatingReadable.js
CHANGED
package/file/FileUtilities.js
CHANGED
|
@@ -12,7 +12,7 @@ const debug = require('debug')('@engine9-io/file');
|
|
|
12
12
|
const { getXlsxStream } = require('xlstream');
|
|
13
13
|
const csv = require('csv');
|
|
14
14
|
const JSON5 = require('json5');
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
const languageEncoding = require('detect-file-encoding-and-language');
|
|
17
17
|
const R2Worker = require('./R2');
|
|
18
18
|
const S3Worker = require('./S3');
|
|
@@ -729,7 +729,8 @@ Worker.prototype.listAll = async function ({ directory, start: s, end: e }) {
|
|
|
729
729
|
if (!start && !end) {
|
|
730
730
|
return files;
|
|
731
731
|
}
|
|
732
|
-
|
|
732
|
+
const pLimit = await import('p-limit');
|
|
733
|
+
pLimit.default();
|
|
733
734
|
const limitedMethod = pLimit(10);
|
|
734
735
|
const filesWithinLimit = [];
|
|
735
736
|
|
|
@@ -774,7 +775,8 @@ Worker.prototype.moveAll = async function (options) {
|
|
|
774
775
|
target: filename.replace(directory, targetDirectory)
|
|
775
776
|
};
|
|
776
777
|
});
|
|
777
|
-
|
|
778
|
+
const pLimit = await import('p-limit');
|
|
779
|
+
pLimit.default();
|
|
778
780
|
const limitedMethod = pLimit(10);
|
|
779
781
|
|
|
780
782
|
return Promise.all(configs.map(({ filename, target }) => limitedMethod(async () => this.move({ filename, target }))));
|
package/file/S3.js
CHANGED
|
@@ -12,7 +12,6 @@ const {
|
|
|
12
12
|
ListObjectsV2Command
|
|
13
13
|
} = require('@aws-sdk/client-s3');
|
|
14
14
|
const { getTempFilename } = require('./tools');
|
|
15
|
-
const { default: pLimit } = require('p-limit');
|
|
16
15
|
|
|
17
16
|
function Worker() {
|
|
18
17
|
this.prefix = 's3';
|
|
@@ -303,6 +302,8 @@ Worker.prototype.moveAll = async function ({ directory, targetDirectory }) {
|
|
|
303
302
|
target: d.replace(directory, targetDirectory)
|
|
304
303
|
}));
|
|
305
304
|
|
|
305
|
+
const pLimit = await import('p-limit');
|
|
306
|
+
pLimit.default();
|
|
306
307
|
const limitedMethod = pLimit(10);
|
|
307
308
|
|
|
308
309
|
return Promise.all(configs.map(({ filename, target }) => limitedMethod(async () => this.move({ filename, target }))));
|