mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(Convert to File Node): Add delimiter convert to csv (#11556)
This commit is contained in:
@@ -17,6 +17,7 @@ export type JsonToSpreadsheetBinaryOptions = {
|
||||
compression?: boolean;
|
||||
fileName?: string;
|
||||
sheetName?: string;
|
||||
delimiter?: string;
|
||||
};
|
||||
|
||||
export type JsonToBinaryOptions = {
|
||||
@@ -59,6 +60,10 @@ export async function convertJsonToSpreadsheetBinary(
|
||||
type: 'buffer',
|
||||
};
|
||||
|
||||
if (fileFormat === 'csv' && options.delimiter?.length) {
|
||||
writingOptions.FS = options.delimiter ?? ',';
|
||||
}
|
||||
|
||||
if (['xlsx', 'ods'].includes(fileFormat) && options.compression) {
|
||||
writingOptions.compression = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user