npm

promise-simple-json2csv

1.0.0 • Public • Published

promise-simple-json2csv

A simple json to csv module build with promise.

NPM Version Downloads Dependency Status License

Usage

var json2csv = require('promise-simple-json2csv');

var authors = [{
  name: 'solee',
  homepage: 'http://solee.me',
  repo: {
    url: 'https://github.com/solee0524/promise-simple-json2csv.git',
    type: 'git'
  },
  keys: ['coo"l', 'lol']
}, {
  name: 'solee_clone',
  homepage: 'http://solee.me',
  repo: {
    url: 'https://github.com/solee0524/promise-simple-json2csv.git',
    type: 'git'
  },
  keys: ['clone', 'myth']
}];

var options = {
  data: authors,
  fields: ['name', 'homepage', 'repo.url', 'keys']
};

json2csv(options).then(function (csv) {
  console.log(csv);
});

data and fields in options must be Array

License

MIT © Bo Li (solee.me)

Package Sidebar

Install

npm i promise-simple-json2csv

Weekly Downloads

4

Version

1.0.0

License

MIT

Last publish

Collaborators

  • solee