module: https://www.npmjs.com/package/objects-to-csv
I want to use this module in Cypress project.
when I am implementing this module in cypress test it throws below error.

I have test using this module in node project and it works as expected.
Example code I am running within Cypress test.
const ObjectsToCsv = require('objects-to-csv');
describe('template spec', () => {
it('objects-to-csv', () => {
// Sample data - two columns, three rows:
const data = [
{ code: 'CA', name: 'California' },
{ code: 'TX', name: 'Texas' },
{ code: 'NY', name: 'New York' },
];
// If you use "await", code must be inside an asynchronous function:
(async () => {
const csv = new ObjectsToCsv(data);
// Save to file:
await csv.toDisk('./test.csv');
// Return the CSV file as string:
console.log(await csv.toString());
})();
})
})
tsconfig.json:
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
What I am doing wrong when running this module within Cypress project.
I am trying the simple implementation code for module within Cypress project. https://www.npmjs.com/package/objects-to-csv
Code is throwing an error.
