const parse = require('csv-parse');
const fs = require('fs');
const results = [];
fs.createReadStream('kepler_data.csv')
.pipe(parse({
comment: "#",
columns: true,
}))
.on("data", (data) => {
results.push(data);
})
.on("err", (err) => {
console.log(err)
})
.on("end", () => {
console.log(results)
});
.pipe(parse({
^
TypeError: parse is not a function
at Object. (C:\Users\pravi\Desktop\node\planets-project\index.js:8:11)
←[90m at Module._compile (node:internal/modules/cjs/loader:1101:14)←[39m
←[90m at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10)←[39m
←[90m at Module.load (node:internal/modules/cjs/loader:981:32)←[39m
←[90m at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m
←[90m at node:internal/main/run_main_module:17:47←[39m