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

jsonexport

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonexport

Makes easy to convert JSON to CSV

  • 3.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
178K
decreased by-1.44%
Maintainers
2
Weekly downloads
 
Created

What is jsonexport?

The jsonexport npm package is a utility that allows you to convert JSON data into CSV format. It is particularly useful for exporting data from JSON APIs or databases into a format that can be easily imported into spreadsheet applications like Microsoft Excel or Google Sheets.

What are jsonexport's main functionalities?

Basic JSON to CSV Conversion

This feature allows you to convert a simple JSON array into CSV format. The code sample demonstrates how to convert an array of JSON objects into a CSV string.

const jsonexport = require('jsonexport');
const data = [{"name":"John","age":30},{"name":"Jane","age":25}];
jsonexport(data, function(err, csv){
    if(err) return console.error(err);
    console.log(csv);
});

Nested JSON to CSV Conversion

This feature allows you to convert nested JSON objects into CSV format. The code sample demonstrates how to handle nested JSON structures and convert them into a flat CSV format.

const jsonexport = require('jsonexport');
const data = [{"name":"John","age":30,"address":{"city":"New York","state":"NY"}},{"name":"Jane","age":25,"address":{"city":"San Francisco","state":"CA"}}];
jsonexport(data, function(err, csv){
    if(err) return console.error(err);
    console.log(csv);
});

Custom Delimiters

This feature allows you to specify custom delimiters for the CSV output. The code sample demonstrates how to use a semicolon as the delimiter instead of the default comma.

const jsonexport = require('jsonexport');
const data = [{"name":"John","age":30},{"name":"Jane","age":25}];
const options = {delimiter: ';'};
jsonexport(data, options, function(err, csv){
    if(err) return console.error(err);
    console.log(csv);
});

Other packages similar to jsonexport

Keywords

FAQs

Package last updated on 12 Jan 2021

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