🎩 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

Convert your js/json object/string into csv string

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

json2csv.js

License GitHub file size in bytes npm

Installation

npm install zll-json2csv
npm i zll-json2csv

Usage

const json2csv = require('zll-json2csv');

// Create a JSON array
const json = [
    {
        name: "John",
        age: 30,
        city: "New York"
    },
    {
        name: "Peter",
        age: 40,
        city: "Los Angeles"
    },
    {
        name: "Amy",
        age: 50,
        city: "Chicago"
    }
];

// Convert JSON array to CSV string
const csv = json2csv(json);

// Print CSV string
console.log(csv);

Output

name,age,city
John,30,New York
Peter,40,Los Angeles
Amy,50,Chicago

Keywords

json

FAQs

Package last updated on 17 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts