How to use xlstream - 2 common examples

To help you get started, we’ve selected a few xlstream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Claviz / bellboy / src / processors / excel-processor.ts View on Github external
async process(processStream: processStream) {
        for (let file of this.files) {
            const filePath = path.join(this.path, file);
            let sheets: (number | string)[] = [];
            if (this.sheets instanceof Function) {
                const allSheets = await getWorksheets({ filePath });
                sheets = await this.sheets(allSheets);
            } else {
                sheets = this.sheets;
            }
            for (let i = 0; i < sheets.length; i++) {
                const readStream = await getXlsxStream({
                    filePath,
                    sheet: sheets[i],
                    withHeader: this.hasHeader,
                    ignoreEmpty: this.ignoreEmpty,
                });
                await processStream(readStream, file, filePath, sheets[i]);
            }
        }
    }
}
github Claviz / bellboy / src / processors / excel-processor.ts View on Github external
async process(processStream: processStream) {
        for (let file of this.files) {
            const filePath = path.join(this.path, file);
            let sheets: (number | string)[] = [];
            if (this.sheets instanceof Function) {
                const allSheets = await getWorksheets({ filePath });
                sheets = await this.sheets(allSheets);
            } else {
                sheets = this.sheets;
            }
            for (let i = 0; i < sheets.length; i++) {
                const readStream = await getXlsxStream({
                    filePath,
                    sheet: sheets[i],
                    withHeader: this.hasHeader,
                    ignoreEmpty: this.ignoreEmpty,
                });
                await processStream(readStream, file, filePath, sheets[i]);
            }
        }
    }
}

xlstream

Turns XLSX into a readable stream.

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis