From 14fc6697527e950ca01e70835019159b0f197581 Mon Sep 17 00:00:00 2001 From: Nick Playfair Date: Mon, 22 Feb 2021 22:00:43 +0000 Subject: [PATCH] get rid of old node script --- index.js | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 index.js diff --git a/index.js b/index.js deleted file mode 100644 index 0f7e4f7..0000000 --- a/index.js +++ /dev/null @@ -1,31 +0,0 @@ -const csvFilePath = './tweed57_smt.csv' -const csv = require('csvtojson') - -// Which components should we remove from the BOM? -const rejectedParts = [ - 'TP1', - 'TP2', - 'TP3', - 'G', - 'U$1', - 'J1', - 'J2', - 'INPUT' -] - -// Return false if the Part value of the object passed in is in the list to remove -function isJunk (element) { - return !rejectedParts.includes(element.Part) -} - -csv({ - delimiter: ";", - includeColumns: /(Part|Value)/, - ignoreEmpty: true -}) - .fromFile(csvFilePath) - .then(jsonObj => { - // Create array containing only relevant parts - let parts = jsonObj.filter(isJunk) - console.log(parts) - }) \ No newline at end of file