Skip to content

Commit a104380

Browse files
authored
Update reader.js
it should work both absolute and relative paths.
1 parent 3793a5d commit a104380

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

danfojs-node/src/io/reader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const read_csv = async (source, configs = {}) => {
1919
let { start, end } = configs;
2020
if (!(source.startsWith("file://") || source.startsWith("http"))) {
2121
//probabily a relative path, append file:// to it
22-
source = `file://${process.cwd()}/${source}`;
22+
source = source.startsWith("/") ? `file://${source}` : `file://${process.cwd()}/${source}`;
2323
}
2424

2525
let tfdata = [];

0 commit comments

Comments
 (0)