Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

body-parser-csv

Package Overview
Dependencies
Maintainers
3
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

body-parser-csv

CSV parser middleware for express.js

  • 1.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
increased by100%
Maintainers
3
Weekly downloads
 
Created
Source

body-parser-csv

This package is inspired by body-parser-xml and is using fast-csv for parsing.

Developed by http://operatorict.cz

Prerequisites

Installation

Install Node

Install all npm modules using command:

npm install

Compilation of typescript code

To compile typescript code into js one-time

npm run build

or run this, to watch all changes

npm run build-watch

from the application's root directory.

Usage

In your project's package.json set dependency to body-parser-csv

npm install body-parser-csv --save

Then import module, e.g.

const bodyParser = require("body-parser");
require("body-parser-csv")(bodyParser);

You can then use body-parser-csv the same way as you would use the body-parser-xml, with csv parsing options inside of the csvParseOptions parameter.

this.express.use(
    bodyParser.csv({
        csvParseOptions: {
            fastcsvParams: {
                headers: true,
                trim: true,
            },
            subscribe: ((json: any) => {
                // some line transformation
                return json;
            }),
        },
        limit: "15MB",
    })
);

Documentation

For generating documentation run npm run generate-docs. TypeDoc source code documentation is located in docs/typedoc.

Contribution guidelines

Please read CONTRIBUTING.md.

Troubleshooting

Contact benak@operatorict.cz

Keywords

FAQs

Package last updated on 24 May 2023

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