Files
joseph.nelson4456 b39fc6e7db
Build and Push Image / build-and-push (push) Failing after 21s
working on code breakup
2026-05-02 23:29:32 -07:00

24 lines
645 B
JavaScript

import config from './config.js';
export async function parseCsv(filePath) {
const fs = require('fs').promises; // Use promises version
const csv = require('csv-parser');
const results = [];
const stream = fs.createReadStream(filePath).pipe(csv());
for await (const row of stream) {
// Map CSV columns to item properties. Adjust this mapping based on your CSV
const item = {
productId: row.productId, // Use productId from CSV
name: row.name,
collectionId: row.collectionId,
imageUrl: row.imageUrl
// Add other properties as needed
};
results.push(item);
}
return results;
}