1.3.1 • Published 4 months ago

express-params-handler v1.3.1

Weekly downloads
1,365
License
MIT
Repository
github
Last release
4 months ago

express-params-handler

npm version Build Status

Express.js v4+ params handler

This lib is replacement of express-params which is made for Express 2.5. Express v4+ deprecated number of features which are in use of that original library. This lib offers similar functionality but doesn't use deprecated methods of new Express.

Installation

npm i express-params-handler

Usage

var expressParams = require('express-params-handler')

var app = express()

app.param('id', expressParams(Number))
app.param('date', expressParams(/^\d{4}-\d{2}-\d{2}$/))

app.get('/by-id/:id', function(req, res, next) {
  // req.params.id will be a number
})

app.get('/by-date/:date', function(req, res, next) {
  // req.params.date will be a string with YYYY-MM-DD format
})

Licence

MIT

1.3.1

4 months ago

1.3.0

7 months ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.2.1

4 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

9 years ago