We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 264001d + ef234cb commit b09f1afCopy full SHA for b09f1af
1 file changed
danfojs-browser/src/core/frame.js
@@ -66,21 +66,8 @@ export class DataFrame extends Ndframe {
66
*/
67
async to_csv(csvFilePath = "") {
68
const csvContent = await super.to_csv();
69
- // behave differently for Node vs Web
70
- if (typeof window === "undefined") {
71
- // Write CSV on Node.js
72
- // eslint-disable-next-line no-undef
73
- const fs = require("fs");
74
- fs.writeFileSync(
75
- csvFilePath,
76
- csvContent,
77
- (err) => err && console.error(err)
78
- );
79
- } else {
80
- // Download CSV on Web
81
- const webCSV = "data:text/csv;charset=utf-8," + csvContent;
82
- window.open(encodeURI(webCSV));
83
- }
+ const webCSV = "data:text/csv;charset=utf-8," + csvContent;
+ window.open(encodeURI(webCSV));
84
return csvContent;
85
}
86
0 commit comments