🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

zll-json2csv

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zll-json2csv - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+1
src/json2csv.min.js
const json2csv=(json,del=",")=>{if(del=del||",","string"==typeof json&&(json=JSON.parse(json)),!Array.isArray(json))throw new Error("First argument must be an array");const keys=Object.keys(json[0]);let csv=`${keys.join(del)}\n`;return json.forEach(row=>{if(Object.keys(row).toString()!=keys.toString())throw new Error("All objects must have the same keys");const values=Object.values(row).join(del);csv+=`${values}\n`}),csv};"undefined"!=typeof module&&(module.exports=json2csv);
+1
-1
{
"name": "zll-json2csv",
"version": "1.0.2",
"version": "1.0.3",
"description": "Convert your js/json object/string into csv string",

@@ -5,0 +5,0 @@ "main": "index.js",