Easily import your CSV data into MySQL with Node.js

It's convenient to import a CSV file into a spreadsheet to crunch numbers. CSV's (comma-seperated-values) and it's brethren (TSV, for tab-separated, etc) are widely used to deliver information. You'll see CSV downloads available all over the place, whether it's your stock broker or bank, or a government agency, and on and on. Spreadsheet programs like LibreOffice Calc offer direct import of these files, and then as a spreadsheet you've got a zillion tools available to crunch numbers, make graphs, etc.

Simple data export and manipulation using Node.js and the node-mysql module

What follows is a fairly simple data processing script to extract data from a Drupal installation in a MySQL database.  The purpose was to export nodes from a Drupal site, reformatting them for some software I'd written to import content into a blogger blog.  In other words, this is the sort of simple data extraction and manipulation tool we write all the time.

The implementation is on the Node.js platform, using the node-mysql module.  I'm liking Node.js because JavaScript makes it fairly easy to write simple code.