- is a Node.js app designed to generate and stream Excel files through various methods using Express. It demonstrates different techniques for creating and serving Excel files using
ExcelJS
andXLSX
libraries.
- Multiple Endpoints: Offers various endpoints to showcase different ways to generate and stream Excel files.
- ExcelJS and XLSX Support: Supports both
ExcelJS
andXLSX
libraries for Excel file generation. - Streamlined with Express: Integrated seamlessly with Express for easy handling of HTTP requests and responses.
- /download-exceljs-1:
Buffer
Generates an Excel file usingexceljs
with aworkbook.xlsx.write
. - /download-exceljs-2:
Stream
Generates an Excel file usingexceljs
with aworkbookWriter
and streams it through aPassThrough
stream (highWaterMark: 1024
). - /download-exceljs-3:
Stream
Generates an Excel file usingexceljs
with aworkbookWriter
and streams it through aPassThrough
stream (highWaterMark: 16 * 1024
). - /download-exceljs-4:
Stream
Generates an Excel file usingexceljs
with aworkbookWriter
and streams it to response. - /download-xlsx-1:
Buffer
Generates an Excel file usingxlsx
with awrite
method. - /prepare-exceljs-1:
Stream
Prepares an Excel template usingexceljs
. - /prepare-xlsx-template-1:
Buffer
Prepares an Excel template usingxlsx-template
. - /upload-exceljs-1: Uploads an Excel file for processing using
exceljs
. The file should be uploaded as a form-data with the key file.
- Node.js: Ensure you have Node.js installed on your machine.
- Docker: Docker and Docker Compose installed.
-
Clone the repository:
git clone https://github.com/js-ak/xlsx-express-operations.git cd xlsx-express-operations
-
Install the dependencies:
npm install
-
Start the server:
npm start
-
Access the endpoints via your browser or tools like
curl
:curl http://localhost:3000/download-exceljs-2
-
Clone the repository:
git clone https://github.com/js-ak/xlsx-express-operations.git cd xlsx-express-operations
-
Build and start the container using Docker Compose:
docker compose up -d
-
The service will be available at
http://localhost:3000
. You can access the endpoints using your browser or tools likecurl
:curl http://localhost:3000/download-exceljs-2