convert-json
Advanced tools
Comparing version 0.2.1 to 0.3.0
@@ -39,3 +39,6 @@ var fs = require('fs'); | ||
default: | ||
callback('Not Support'); | ||
if(config.type==='csv' && config.input) | ||
return this.cvCSV(config, callback); | ||
else | ||
return callback('Not Support'); | ||
} | ||
@@ -42,0 +45,0 @@ } |
{ | ||
"name": "convert-json", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "auto detect file type and convert it to json format", | ||
@@ -27,7 +27,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"xls-to-json": "0.1.1", | ||
"xlsx-to-json": "0.1.1", | ||
"node-csv-json": "0.1.1", | ||
"xls-to-json": "0.2.1", | ||
"xlsx-to-json": "0.2.1", | ||
"node-csv-json": "0.2.1", | ||
"xml-to-json": "0.1.0", | ||
"node-tsv-json": "~0.1.0" | ||
"node-tsv-json": "~0.2.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
@@ -43,2 +43,19 @@ # Convert JSON | ||
#### input string to csv | ||
if you input string istead a file path, bring a `type` parameter | ||
```javascript | ||
cv_json({ | ||
type: 'csv', | ||
input: "<csv string...>", | ||
output: null | ||
}, function(err, result) { | ||
if(err) { | ||
console.error(err); | ||
}else { | ||
console.log(result); | ||
} | ||
} | ||
); | ||
``` | ||
@@ -45,0 +62,0 @@ ## License |
195015
244
64
+ Addednode-csv-json@0.2.1(transitive)
+ Addednode-tsv-json@0.2.1(transitive)
+ Addedxls-to-json@0.2.1(transitive)
+ Addedxlsx-to-json@0.2.1(transitive)
- Removednode-csv-json@0.1.1(transitive)
- Removednode-tsv-json@0.1.0(transitive)
- Removedxls-to-json@0.1.1(transitive)
- Removedxlsx-to-json@0.1.1(transitive)
Updatednode-csv-json@0.2.1
Updatednode-tsv-json@~0.2.0
Updatedxls-to-json@0.2.1
Updatedxlsx-to-json@0.2.1