Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2csv

Package Overview
Dependencies
Maintainers
3
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2csv - npm Package Compare versions

Comparing version 3.6.0 to 3.6.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 3.6.1 / 2016-07-12
* Fix auto-fields returning all avilable fields, even if not available on the first object, see #104
## 3.6.0 / 2016-07-07

@@ -2,0 +6,0 @@

@@ -6,2 +6,4 @@ /**

var lodashGet = require('lodash.get');
var lodashFlatten = require('lodash.flatten');
var lodashUniq = require('lodash.uniq');
var flatten = require('flat');

@@ -21,4 +23,4 @@

var hasCallback = typeof callback === 'function';
var err;
var err;
try {

@@ -35,4 +37,6 @@ checkParams(params);

}
var titles = createColumnTitles(params);
var csv = createColumnContent(params, titles);
if (hasCallback) {

@@ -73,5 +77,14 @@ return process.nextTick(function () {

}
params.fields = params.fields || Object.keys(params.data[0]);
if (!params.fields) {
var dataFields = params.data.map(function (item) {
return Object.keys(item);
});
dataFields = lodashFlatten(dataFields);
params.fields = lodashUniq(dataFields);
debugger;
}
//#check fieldNames

@@ -78,0 +91,0 @@ if (params.fieldNames && params.fieldNames.length !== params.fields.length) {

4

package.json
{
"name": "json2csv",
"preferGlobal": "true",
"version": "3.6.0",
"version": "3.6.1",
"description": "Convert JSON to CSV",

@@ -37,3 +37,5 @@ "keywords": [

"flat": "^2.0.0",
"lodash.flatten": "^4.2.0",
"lodash.get": "^4.3.0",
"lodash.uniq": "^4.3.0",
"path-is-absolute": "^1.0.0"

@@ -40,0 +42,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