get rid of old node script
This commit is contained in:
parent
73b4deec6b
commit
14fc669752
31
index.js
31
index.js
@ -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)
|
|
||||||
})
|
|
Loading…
x
Reference in New Issue
Block a user