Node.js Import Excel File to MySQL – using Read-Excel-File lib
Tags: node, mysql, readexcelfile
Published: 2021-05-16 10:34:58

https://grokonez.com/node-js/node-js-import-excel-file-to-mysql-using-read-excel-file-lib

Node.js Import Excel File to MySQL – using Read-Excel-File lib


<!-- wp:paragraph -->
<p>In the tutorial, Grokonez shows how to import data from Excel File to MySQL with Node.js using <code>Read-Excel-File</code> lib.</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<!--more-->
<!-- /wp:html -->

<!-- wp:heading {"level":3} -->
<h2>Technologies</h2>
<!-- /wp:heading -->

<!-- wp:list -->
<ul><li>Node.js</li><li>MySQL</li><li>Read-Excel-File lib</li></ul>
<!-- /wp:list -->

<!-- wp:heading {"level":3} -->
<h2>Goal</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>- We create a Node.js project as below structure:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":17064} -->
<figure class="wp-block-image"><img src="https://grokonez.com/wp-content/uploads/2019/03/node.js-import-excel-file-to-mysql-using-read-excel-file-lib-project-structure.png" alt="node.js-import-excel-file-to-mysql-using-read-excel-file-lib-project-structure" class="wp-image-17064"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>- Excel File:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":17065} -->
<figure class="wp-block-image"><img src="https://grokonez.com/wp-content/uploads/2019/03/node.js-import-excel-file-to-mysql-using-read-excel-file-lib-excel-file.png" alt="node.js-import-excel-file-to-mysql-using-read-excel-file-lib-excel-file" class="wp-image-17065"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>-&gt; Results:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"id":17066} -->
<figure class="wp-block-image"><img src="https://grokonez.com/wp-content/uploads/2019/03/node.js-import-excel-file-to-mysql-using-read-excel-file-lib-mysql-records.png" alt="node.js-import-excel-file-to-mysql-using-read-excel-file-lib-mysql-records" class="wp-image-17066"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h2>Practice</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":5} -->
<h3>Install MySQL &amp; Read-Excel-File</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Init <code>package.json</code> file by cmd: <code>npm init</code> -&gt; Then install <code>mysql</code> &amp; <code>read-excel-file</code> libs:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre><code class="language-javascript">$ npm install mysql 
$ npm install read-excel-file 
</code></pre>
<!-- /wp:html -->

<!-- wp:paragraph -->
<p>-&gt; <code>package.json</code> file:</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre><code class="language-javascript">{
  "name": "nodejs-import-excel-file-to-mysql",
  "version": "1.0.0",
  "description": "Nodejs Import Excel File to MySQL with Read-Excel-File ",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
  },
  "keywords": [
    "Nodejs",
    "MySQL",
    "Excel",
    "Read-Excel-File"
  ],
  "author": "grokonez.com",
  "license": "ISC",
  "dependencies": {
    "mysql": "^2.16.0",
    "read-excel-file": "^2.0.7"
  }
}</code></pre>
<!-- /wp:html -->

<!-- wp:heading {"level":5} -->
<h3>Import Excel File to MySQL</h3>

More at:

https://grokonez.com/node-js/node-js-import-excel-file-to-mysql-using-read-excel-file-lib

Node.js Import Excel File to MySQL – using Read-Excel-File lib