项目原始demo,不改动
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

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