Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/csv-generate/test/samples.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from "node:fs/promises";
import path from "node:path";
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const dir = path.resolve(__dirname, "../samples");
const samples = await fs.readdir(dir);

Expand Down
3 changes: 2 additions & 1 deletion packages/csv-parse/samples/columns-discovery.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import { parse } from "csv-parse";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));

// Using the first line of the CSV data to discover the column names
const rs = fs.createReadStream(__dirname + "/columns-discovery.in");
Expand Down
3 changes: 2 additions & 1 deletion packages/csv-parse/samples/fs_read.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import { parse } from "csv-parse";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));

const parser = parse({ delimiter: ";" }, function (err, data) {
console.info(data);
Expand Down
3 changes: 2 additions & 1 deletion packages/csv-parse/samples/recipe.async.iterator.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import { parse } from "csv-parse";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));

const processFile = async () => {
const records = [];
Expand Down
3 changes: 2 additions & 1 deletion packages/csv-parse/test/samples.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from "node:fs/promises";
import path from "node:path";
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const dir = path.resolve(__dirname, "../samples");
const samples = await fs.readdir(dir);

Expand Down
3 changes: 2 additions & 1 deletion packages/csv-stringify/test/samples.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from "node:fs/promises";
import path from "node:path";
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const dir = path.resolve(__dirname, "../samples");
const samples = await fs.readdir(dir);

Expand Down
3 changes: 2 additions & 1 deletion packages/csv/samples/example.fs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import fs from "node:fs";
import assert from "node:assert";
import { finished } from "node:stream/promises";
import { fileURLToPath } from "node:url";
import { parse, transform, stringify } from "csv";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
await fs.promises.writeFile(
`${__dirname}/example.fs.input.csv`,
"a,b,c\n1,2,3",
Expand Down
3 changes: 2 additions & 1 deletion packages/csv/test/samples.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from "node:fs/promises";
import path from "node:path";
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const dir = path.resolve(__dirname, "../samples");
const samples = await fs.readdir(dir);

Expand Down
3 changes: 2 additions & 1 deletion packages/stream-transform/test/samples.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import fs from "node:fs/promises";
import path from "node:path";
import { spawn } from "node:child_process";
import { fileURLToPath } from "node:url";

const __dirname = new URL(".", import.meta.url).pathname;
const __dirname = fileURLToPath(new URL(".", import.meta.url));
const dir = path.resolve(__dirname, "../samples");
const samples = await fs.readdir(dir);

Expand Down