@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.
@@ -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(`Error reading file ${filename}, current directory: ${process.cwd()},__dirname:${__dirname}`);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@engine9-io/input-tools",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "type": "module",
5
5
  "description": "Tools for dealing with Engine9 inputs",
6
6
  "main": "index.js",
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: __dirname + '/sample/fileWithHead.csv' });
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: __dirname + '/sample/fileWithoutHead.csv' });
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
  });