@engine9-io/input-tools 2.0.1 → 2.0.2
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/file/FileUtilities.js +5 -1
- package/package.json +1 -1
- package/test/file.js +2 -2
package/file/FileUtilities.js
CHANGED
|
@@ -530,7 +530,11 @@ Worker.prototype.stream = async function (options) {
|
|
|
530
530
|
try {
|
|
531
531
|
await fsp.stat(filename);
|
|
532
532
|
} catch (e) {
|
|
533
|
-
debug(
|
|
533
|
+
debug(
|
|
534
|
+
`Error reading file ${filename}, current directory: ${process.cwd()},import.meta.dirname:${
|
|
535
|
+
import.meta.dirname
|
|
536
|
+
}`
|
|
537
|
+
);
|
|
534
538
|
throw e;
|
|
535
539
|
}
|
|
536
540
|
stream = fs.createReadStream(filename);
|
package/package.json
CHANGED
package/test/file.js
CHANGED
|
@@ -16,8 +16,8 @@ it('Should list a directory', async () => {
|
|
|
16
16
|
});
|
|
17
17
|
it('Should be able to analyze CSV files with and without header lines', async () => {
|
|
18
18
|
const futil = new FileUtilities({ accountId: 'test' });
|
|
19
|
-
const f1 = await futil.columns({ filename:
|
|
19
|
+
const f1 = await futil.columns({ filename: import.meta.dirname + '/sample/fileWithHead.csv' });
|
|
20
20
|
assert.equal(f1.likelyHeaderLines, 1, 'Number of header lines should be 1');
|
|
21
|
-
const f2 = await futil.columns({ filename:
|
|
21
|
+
const f2 = await futil.columns({ filename: import.meta.dirname + '/sample/fileWithoutHead.csv' });
|
|
22
22
|
assert.equal(f2.likelyHeaderLines, 0, 'Number of header lines should be 1');
|
|
23
23
|
});
|