New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

json2csv-export

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2csv-export

A javascript library to convert json array into csv

  • 1.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

json2csv-export

A simplest javascript library that help you generate csv file and export

Install Package

npm install json2csv-export --save

or

yarn add json2csv-export

or use cdn bellow before end of body tag

<script src="https://unpkg.com/json2csv-export@1.0.5/index.js"></script>

Example

import { exportCsv } from "json2csv-export";

const yourCustomFunction = () => {
  const header = {
    name: "Fullname",
    age: "Age",
    designation: "Designation",
    role: "Profession",
    education: "Study",
    hometown: "Current City",
    email: "Email Address",
    post: "Total Post",
  };

  const data = [
    {
      name: "Shahan Chowdhury",
      age: "26",
      designation: "Mr.",
      role: "Software Engineer",
      education: "Computer Science and Engineering",
      hometown: "Sylhet",
      email: "shahan@test.com",
      post: 27,
    },
    {
      name: "Rayhan Chowdhury",
      age: "31",
      designation: "Mr.",
      role: "Test Engineer",
      education: "CS",
      hometown: "Sylhet",
      email: "rayhan@test.com",
      post: 25,
    },
  ];
  exportCsv({
    header, // header is optional. If you don't pass header, it will take keys from data
    data,
    filename: 'yourfilename' // the file will downloaded yourfilename.csv
  });
};

`

Support me by giving star

Keywords

FAQs

Package last updated on 30 Sep 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

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