Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / compressible / README.md
1 # compressible
2
3 [![NPM Version][npm-image]][npm-url]
4 [![NPM Downloads][downloads-image]][downloads-url]
5 [![Node.js Version][node-version-image]][node-version-url]
6 [![Build Status][travis-image]][travis-url]
7 [![Test Coverage][coveralls-image]][coveralls-url]
8
9 Compressible `Content-Type` / `mime` checking.
10
11 ## Installation
12
13 ```bash
14 $ npm install compressible
15 ```
16
17 ## API
18
19 ```js
20 var compressible = require('compressible')
21 ```
22
23 ### compressible(type)
24
25 Checks if the given `Content-Type` is compressible. The `type` argument is expected
26 to be a value MIME type or `Content-Type` string, though no validation is performed.
27
28 The MIME is looked up in the [`mime-db`](https://www.npmjs.com/package/mime-db) and
29 if there is compressible information in the database entry, that is returned. Otherwise,
30 this module will fallback to `true` for the following types:
31
32   * `text/*`
33   * `*/*+json`
34   * `*/*+text`
35   * `*/*+xml`
36
37 If this module is not sure if a type is specifically compressible or specifically
38 uncompressible, `undefined` is returned.
39
40 ```js
41 compressible('text/html') // => true
42 compressible('image/png') // => false
43 ```
44
45 ## License
46
47 [MIT](LICENSE)
48
49 [npm-image]: https://img.shields.io/npm/v/compressible.svg
50 [npm-url]: https://npmjs.org/package/compressible
51 [node-version-image]: https://img.shields.io/node/v/compressible.svg
52 [node-version-url]: https://nodejs.org/en/download/
53 [travis-image]: https://img.shields.io/travis/jshttp/compressible/master.svg
54 [travis-url]: https://travis-ci.org/jshttp/compressible
55 [coveralls-image]: https://img.shields.io/coveralls/jshttp/compressible/master.svg
56 [coveralls-url]: https://coveralls.io/r/jshttp/compressible?branch=master
57 [downloads-image]: https://img.shields.io/npm/dm/compressible.svg
58 [downloads-url]: https://npmjs.org/package/compressible