node-tsv-json
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -35,3 +35,3 @@ var fs = require('fs'); | ||
for (var j = 0; j < field.length; j++) { | ||
obj[field[j]] = record[i][j] | ||
obj[field[j].trim()] = record[i][j].trim(); | ||
} | ||
@@ -38,0 +38,0 @@ remake_arr.push(obj) |
{ | ||
"name": "node-tsv-json", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "convert tsv to json", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,3 @@ # node-tsv-json | ||
```javascript | ||
tsv = require("tsv-to-json"); | ||
tsv = require("node-tsv-json"); | ||
tsv({ | ||
@@ -19,0 +19,0 @@ input: "sample.tsv", |
13
test.js
@@ -47,2 +47,15 @@ var should = require('should'); | ||
it('should convert space tsv', function(cb) { | ||
tsv2json({ | ||
input: './sample/users.tsv', | ||
output: null | ||
}, function(err, result) { | ||
should.not.exist(err) | ||
result.should.be.an.instanceOf(Object) | ||
var re= /\s/ | ||
re.test(result[0].name).should.be.false; | ||
cb(); | ||
}) | ||
}) | ||
}) |
Sorry, the diff of this file is not supported yet
74474
11
131