nodejs module for evaluting conditional request
npm install http-preconditions[![NPM Version][npm-image]][npm-url]

This module provides utilites for evaluating conditional requests (as defined in RFC 7232)
This is a Node.js module available through the
npm registry. Installation is done using thenpm install command:
``sh`
$ npm install http-preconditionsUsage
`js`
var precondition = require('http-preconditions')$3
#### req
req nodejs request object
#### options
The precondition constructor take an options argument which should be any one
of the following
##### weak
when set to true, enable weak etag comparison. Defaults to false
##### etag
String value represents the resources etag metadata.
##### lastModified
Resource last-modified date as http-date string
`js
var precondition = require('http-preconditions')
var precondition = new precondition(req, {weak: true, etag: 'W/blahblahblah'})
`$3
Returns the result of evaluating the preconditions in the request
`js
var precondition = require('http-preconditions')
var precondition = new precondition(req, {weak: true, etag: 'W/blahblahblah'})
if (precondition.condition) {
res.status(200)
}
`$3
Returns true if request contains an if-range precondition header field
Return true if request is a cache revalidation request
Returns true` if request is a conditional request
[npm-url]: https://www.npmjs.com/package/http-preconditions
[npm-image]: https://img.shields.io/badge/npm-v6.14-blue
[http-date-image]: https://img.shields.io/badge/http-preconditions-v1.0.0-success