Socket
Socket
Sign inDemoInstall

json-2-csv

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-2-csv - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

13

lib/converter.js

@@ -7,3 +7,4 @@ 'use strict';

docPath = require('doc-path'),
_ = require('underscore'); // Require underscore
promise = require('bluebird'),
_ = require('underscore');

@@ -67,3 +68,3 @@ /**

// Export the following functions that will be client accessible
module.exports = {
var exports = {

@@ -121,1 +122,9 @@ /**

};
// Promisified json2csv:
exports.json2csvPromisified = promise.promisify(exports.json2csv);
// Promisified csv2json:
exports.csv2jsonPromisified = promise.promisify(exports.csv2json);
module.exports = exports;

12

package.json

@@ -5,3 +5,3 @@ {

"description": "A JSON to CSV and CSV to JSON converter that natively supports sub-documents and auto-generates the CSV heading.",
"version": "2.1.2",
"version": "2.2.0",
"repository": {

@@ -29,15 +29,15 @@ "type": "git",

"underscore": "1.8.3",
"doc-path": "1.2.0",
"doc-path": "1.2.1",
"bluebird": "3.5.1"
},
"devDependencies": {
"mocha": "3.3.0",
"mocha": "5.0.1",
"istanbul": "0.4.5",
"should": "13.1.2",
"async": "2.5.0"
"should": "13.2.1",
"async": "2.6.0"
},
"engines": {
"node": "*"
"node": ">= 4"
},
"license": "MIT"
}

@@ -29,8 +29,4 @@ # Convert JSON to CSV or CSV to JSON

#### json2csv Documentation
#### json2csv(array, callback, options)
```javascript
json2csv(array, callback, options)
```
* `array` - An array of JSON documents to be converted to CSV.

@@ -69,8 +65,8 @@ * `callback` - A function of the form `function (err, csv)`;

#### csv2json Documentation
#### Promisified Version: json2csvPromisified(array, options).then(...).catch(...);
```javascript
csv2json(csv, callback, options)
```
Available in version `2.2.0`, this functionality makes use of promises from the `bluebird` module.
#### csv2json(csv, callback, options)
* `csv` - A string of CSV

@@ -99,2 +95,6 @@ * `callback` - A function of the form `function (err, array)`; This function will receive any errors and/or the array of JSON documents generated.

#### Promisified Version: csv2jsonPromisified(csv, options).then(...).catch(...);
Available in version `2.2.0`, this functionality makes use of promises from the `bluebird` module.
## Tests

@@ -136,1 +136,2 @@

* Support for multiple different schemas (as of 1.4.0)
* Promisified versions of the functions are now available by default: json2csvPromisified, csv2jsonPromisified (as of 2.2.0)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc