Socket
Socket
Sign inDemoInstall

connect-csvboy

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-csvboy

Express/Connect middleware to threat requests with CSV contents


Version published
Maintainers
1
Created
Source

connect-csvboy

Express middleware to check user access based on the ressources URIs and HTTP methods.

NPM version Build status Dependency Status devDependency Status Coverage Status Code Climate

Usage

var csvboy = require('connect-csvboy');

// Add the middleware
app.use(csvboy());

// Consume the request
app.use(function(req, res, next) {
  // Pipe the request
  req.pipe(req.csvboy);

  // Consume the rows
  req.csvboy.on('readable', function() {
    var row;
    while(null !== (row = req.csvboy.read())) {
      console.log('New row:', row);
      // do whatever you want with the row (ex: insert in a db)
    }
  });
  req.csvboy.on('finish', function() {
    res.send(204);
  });

  // Threat errors
  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 NPM

Keywords

FAQs

Package last updated on 20 Jun 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc