strict-accepts

1.0.1 • Public • Published

stricct-accepts

Higher level content negotiation based on accepts with strict validate.

Example

var accepts = require('strict-accepts');
 
var req = {
  headers: {
    ...
    accept: 'text/html, */*; q=0.1'
  }
}
 
console.log(accepts.typeOf(req, 'js'))
// -> false
 
console.log(accepts.typeOf(req, 'html'))
// -> true

Readme

Keywords

Package Sidebar

Install

npm i strict-accepts

Weekly Downloads

1

Version

1.0.1

License

ISC

Last publish

Collaborators

  • allex