New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@willaug/json-csv-converter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@willaug/json-csv-converter

convert json file to csv file or vice versa

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Npm ci license LinkedIn

JsonCsvConverter

Convert JSON file to CSV file or vice versa

📖 About

This repository was created for convert files, that's it, it will create a new file with the new extension.

Supported extensions: CSV and JSON.

🚀 Getting Started

First, you need to install this package:

  npm install @willaug/json-csv-converter

or

  yarn add @willaug/json-csv-converter

Then, you will can call two functions to convert files:

const { convertJsonToCsv } = require('@willaug/json-csv-converter');

// path: where the file to convert is (string)
// savePath: where the new file will be created (string)

const path = '../public/jsonfile.json';
const savePath = '../public';

const result = await convertJsonToCsv(path, savePath);
/**
  *  result = {
  *    message: 'success!',
  *    filename: 'ed90767a013c98dd.csv',
  *    filepath: '/home/yourUser/yourProject/public/ed90767a013c98dd.csv',
  *  }
  */

and

const { convertCsvToJson } = require('@willaug/json-csv-converter');

// path: where the file to convert is (string)
// savePath: where the new file will be created (string)

const path = '../public/csvfile.csv';
const savePath = '../public';

const result = await convertCsvToJson(path, savePath);
/**
  *  result = {
  *    message: 'success!',
  *    filename: 'ed90767a013c98dd.json',
  *    filepath: '/home/yourUser/yourProject/public/ed90767a013c98dd.json',
  *  }
  */

Node versions supported: 16v or highter.

💟 Thank you

Thanks for read this documentation and install this package. This repository was created for learning and you can contact me by the email william.santos315@outlook.com <3.

Keywords

json

FAQs

Package last updated on 07 Aug 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