Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vajahath/gulp-json2csv
Gulp plugin to convert json to csv format.
https://github.com/vajahath/gulp-json2csv
csv csv-parser gulp json parser
Last synced: 13 days ago
JSON representation
Gulp plugin to convert json to csv format.
- Host: GitHub
- URL: https://github.com/vajahath/gulp-json2csv
- Owner: vajahath
- License: mit
- Created: 2017-03-24T12:02:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-09T19:19:14.000Z (over 5 years ago)
- Last Synced: 2024-12-19T10:43:32.917Z (about 1 month ago)
- Topics: csv, csv-parser, gulp, json, parser
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/gulp-json2csv
- Size: 169 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gulp-json2csv
Gulp plugin to Convert json to csv format.
[![npm](https://img.shields.io/badge/Gulp-Plugin-red.svg)](https://www.npmjs.com/package/gulp-json2csv) [![npm](https://img.shields.io/npm/v/gulp-json2csv.svg)](https://www.npmjs.com/package/gulp-json2csv)
[![Build Status](https://travis-ci.org/vajahath/gulp-json2csv.svg?branch=master)](https://travis-ci.org/vajahath/gulp-json2csv)
[![Known Vulnerabilities](https://snyk.io/test/npm/gulp-json2csv/badge.svg)](https://snyk.io/test/npm/gulp-json2csv)
[![Greenkeeper badge](https://badges.greenkeeper.io/vajahath/gulp-json2csv.svg)](https://greenkeeper.io/)
[![npm](https://img.shields.io/npm/dt/gulp-json2csv.svg)](https://www.npmjs.com/package/gulp-json2csv)> You can also use this package to convert json to excel format by simply renaming the output extension to excel's extension.
This plugin is backed by [json2csv](https://www.npmjs.com/package/json2csv) module.
## Install
```
$ npm install --save-dev gulp-json2csv
```## Usage
```js
const gulp = require('gulp');
const json2csv = require('gulp-json2csv');gulp.task('default', function() {
gulp
.src('src/file.json')
.pipe(json2csv())
.pipe(gulp.dest('dist'));
});
```## Example
input:
```json
[
{
"car": "Audi",
"price": 40000,
"color": "blue"
},
{
"car": "BMW",
"price": 35000,
"color": "black"
},
{
"car": "Porsche",
"price": 60000,
"color": "green"
}
]
```output =>
```
"car", "price", "color"
"Audi", 40000, "blue"
"BMW", 35000, "black"
"Porsche", 60000, "green"
```
## Change log
* **1.1.0**
* integrates [json2csv](https://github.com/zemirco/json2csv) v4.0.2
* **1.0.3, 1.0.4, 1.0.5, 1.0.6**
* docs update## License
MIT © [Vajahath Ahmed](https://facebook.com/vajahath.ahmed)
[badge_paypal_donate]: https://cdn.rawgit.com/vajahath/cloud-codes/a01f087f/badges/paypal_donate.svg
[paypal-donations]: https://paypal.me/vajahath