https://ozenero.com/node-js-extract-mysql-data-to-excel-xlsx-file-using-exceljs
Node.js Extract MySQL Data to Excel(.xlsx) File – using exceljs
In the tutorial, Grokonez shows how to extract data from MySQL to Excel(.xlsx) File with Node.js using exceljs
lib.
Technologies
- Node.js
- MySQL
- exceljs
Goal
– We create a Node.js project as below structure:
– MySQL Data:
– Excel File:
Practice
Install MySQL & Exceljs
- Init
package.json
file by cmd:npm init
-> Then installmysql
&exceljs
libs:
$npm install --save mysql
$npm install --save exceljs
-> package.json
file:
{
"name": "nodejs-export-mysql-data-to-excel-file",
"version": "1.0.0",
"description": "Nodejs exports MySQL data to Excel file",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"keywords": [
"Nodejs",
"MySQL",
"Excel"
],
"author": "ozenero.com",
"license": "ISC",
"dependencies": {
"exceljs": "^1.7.0",
"mysql": "^2.16.0"
}
}
Extract MySQL Data to Excel
More at:
https://ozenero.com/node-js-extract-mysql-data-to-excel-xlsx-file-using-exceljs
Top comments (1)
Great and simple example. using json data structure to write them to xls