From cc90868a6311ca11b76a451304d2b4dc50a78695 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Sun, 17 Jul 2022 13:16:43 -0400 Subject: [PATCH] A first step in the 01 module that just loads a bunch of samples from csv-spectrum and then parses them. --- 01-parse-a-csv-file/package.json | 16 ++++++++++++++++ 01-parse-a-csv-file/step1.js | 8 ++++++++ README.md | 3 --- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 01-parse-a-csv-file/package.json create mode 100644 01-parse-a-csv-file/step1.js delete mode 100644 README.md diff --git a/01-parse-a-csv-file/package.json b/01-parse-a-csv-file/package.json new file mode 100644 index 0000000..dbc281f --- /dev/null +++ b/01-parse-a-csv-file/package.json @@ -0,0 +1,16 @@ +{ + "name": "01-parse-a-csv-file", + "version": "1.0.0", + "description": "", + "type": "module", + "main": "step1.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "BSD", + "dependencies": { + "csv-spectrum": "^1.0.0", + "neat-csv": "^7.0.0" + } +} diff --git a/01-parse-a-csv-file/step1.js b/01-parse-a-csv-file/step1.js new file mode 100644 index 0000000..02f9a9f --- /dev/null +++ b/01-parse-a-csv-file/step1.js @@ -0,0 +1,8 @@ +import spectrum from "csv-spectrum"; +import csv from "neat-csv"; + +spectrum(async (err, data) => { + for(let sample of data) { + console.log(await csv(sample.csv.toString())); + } +}); diff --git a/README.md b/README.md deleted file mode 100644 index c5f5ec5..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# js-level-2-projects - -These are the projects for the JavaScript Level 2 module in Learn JS the Hard Way. \ No newline at end of file