1.0.3 • Published 1 year ago

req-parser v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

req-parser

npm dependents install size Downloads NPM Version

run on repl.it

A lightweight and flexible middleware for parsing the request body in Express.

Installation

Install with npm:

npm install req-parser

Usage

const express = require("express");
const bodyParser = require("req-parser");

const app = express();

// Use bodyParser middleware
app.use(bodyParser);

// Handle POST requests
app.post("/", (req, res) => {
  console.log(req.body);
  res.send("Got it!");
});

app.listen(3000, () => {
  console.log("Server listening on port 3000");
});

Options The middleware automatically detects the content type of the request body and parses it accordingly. Supported content types are:

  • application/json
  • application/x-www-form-urlencoded
  • any other content type (treated as plain text)

License ISC

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

1.0.3

1 year ago

0.2.4

6 years ago

0.2.3

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago