Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

we-plugin-csv

We.js plugin do add csv response type and set we.csv attribute with https://github.com/wdavidw/node-csv module

Installation

we i we-plugin-csv

Configuration

For responses related to model

file: config/local.js

    csv: {
      // configure your model coluns with this
      modelColumns: {
        // Example for user model:
        user: {
           userId: 'id',
           displayName: 'displayName',
           fullName: 'fullName',
           biography: 'biography',
           gender: 'gender'
        }
      }
    }

For configure csv columns in controller:

// in your controller
res.locals.csvResponseColumns = {
    userId: 'id',
    displayName: 'displayName',
    fullName: 'fullName',
    biography: 'biography',
    status: 'gender'
};

API

Use the responseType API

http://localhost:4000/user.csv

Lib

Links

License

Under the MIT license.

About

We.js plugin to add csv module for parse and generate csv files and requests

Resources

Releases

No releases published

Packages

No packages published