connect-csvboy
Express middleware to check user access based on the ressources URIs and
HTTP methods.
![Code Climate](https://codeclimate.com/github/SimpliField/connect-csvboy.png)
Usage
var csvboy = require('connect-csvboy');
app.use(csvboy());
app.use(function(req, res, next) {
req.pipe(req.csvboy);
req.csvboy.on('readable', function() {
var row;
while(null !== (row = req.csvboy.read())) {
console.log('New row:', row);
}
});
req.csvboy.on('finish', function() {
res.send(204);
});
req.csvboy.on('error', function(err) {
req.unpipe(req.csvboy);
next(err);
});
});
API
reaccess(options)
options
Type: Object
The options of the reaccess middleware.
options.mimes
Type: Array
Default: ['text/csv']
Mime type that csvboy should listen for.
options.methods
Type: Array
Default: ['POST', 'PUT', 'PATCH']
HTTP methods that csvboy should listen for.
options.immediate
Type: Boolean
Default: false
Immediatly pipe the request in the csv parser.
options.csvOptions
Type: Object
The CSV parser options. See the
oh-csv README file.
Stats
![NPM](https://nodei.co/npm-dl/connect-csvboy.png)