Skip to content

Commit a93c202

Browse files
committed
Create csv2json.js; prevent files that aren't .csv from being used
1 parent 78d5339 commit a93c202

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

csv2json.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = function(file) {
2+
var fs = require('fs');
3+
var path = require('path');
4+
5+
if (path.extname(file) != '.csv') {
6+
console.log("Invalid file. Files with extension .csv only.")
7+
}
8+
fs.readFile(file, function(err, data) {
9+
10+
});
11+
}

0 commit comments

Comments
 (0)