compressible
Compressible Content-Type / mime checking
Last updated 5 years ago by dougwilson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install compressible 
SYNC missed versions from official npm registry.

compressible

NPM Version NPM Downloads Node.js Version Build Status Test Coverage

Compressible Content-Type / mime checking.

Installation

$ npm install compressible

API

var compressible = require('compressible')

compressible(type)

Checks if the given Content-Type is compressible. The type argument is expected to be a value MIME type or Content-Type string, though no validation is performed.

The MIME is looked up in the mime-db and if there is compressible information in the database entry, that is returned. Otherwise, this module will fallback to true for the following types:

  • text/*
  • */*+json
  • */*+text
  • */*+xml

If this module is not sure if a type is specifically compressible or specifically uncompressible, undefined is returned.

compressible('text/html') // => true
compressible('image/png') // => false

License

MIT

Current Tags

  • 2.0.18                                ...           latest (5 years ago)

26 Versions

  • 2.0.18                                ...           5 years ago
  • 2.0.17                                ...           6 years ago
  • 2.0.16                                ...           6 years ago
  • 2.0.15                                ...           6 years ago
  • 2.0.14                                ...           6 years ago
  • 2.0.13                                ...           7 years ago
  • 2.0.12                                ...           7 years ago
  • 2.0.11                                ...           7 years ago
  • 2.0.10                                ...           8 years ago
  • 2.0.9                                ...           8 years ago
  • 2.0.8                                ...           9 years ago
  • 2.0.7                                ...           9 years ago
  • 2.0.6                                ...           9 years ago
  • 2.0.5                                ...           9 years ago
  • 2.0.4                                ...           9 years ago
  • 2.0.3                                ...           9 years ago
  • 2.0.2                                ...           10 years ago
  • 2.0.1                                ...           10 years ago
  • 2.0.0                                ...           10 years ago
  • 1.1.1                                ...           10 years ago
  • 1.1.0                                ...           10 years ago
  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Downloads
Total 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE