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

jsonexport

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonexport - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

23

lib/index.js

@@ -82,9 +82,25 @@ /**

}
parseResult.forEach(function (result) {
//Initialize the array with empty strings to handle 'unpopular' headers
var row = Array(headers.length).join(".").split(".");
var resultRows = [Array(headers.length).join(".").split(".")];
result.forEach(function(element){
row[headers.indexOf(element.item)] = element.value;
var placed = false;
resultRows.forEach(function (row) {
if(!placed && row[headers.indexOf(element.item)] == ''){
row[headers.indexOf(element.item)] = element.value;
placed = true;
}
});
if(!placed){
var newRow = Array(headers.length).join(".").split(".");
newRow[headers.indexOf(element.item)] = element.value;
resultRows.push(newRow);
}
});
fileRows.push(row.join(options.rowDelimiter));
resultRows.forEach(function (row) {
fileRows.push(row.join(options.rowDelimiter));
});
});

@@ -259,2 +275,3 @@ //Merge all rows in a single output with the correct End of Line string

var resultCheckType = checkType(element);
//Append to results

@@ -261,0 +278,0 @@ result = result.concat(resultCheckType);

2

package.json
{
"name": "jsonexport",
"version": "1.0.4",
"version": "1.0.5",
"description": "Makes easy to convert JSON to CSV",

@@ -5,0 +5,0 @@ "main": "./lib",

# jsonexport
This module makes easy to convert JSON to CSV and its very customizable.
Changelog
----------------------
v1.05 - Create new lines in the CSV file to handle JSON objects with arrays<br>
# Usage

@@ -5,0 +9,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