forked from bazzoink/angular-count-to
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
29 lines (29 loc) · 4.85 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{
"name": "connect-gzip",
"description": "Gzip middleware for Connect. Based on implementation in Connect 0.5.9. Original source: https://github.com/senchalabs/connect/tree/c9a0c1e0e98451bb5fffb70c622b827a11bf4fc7",
"version": "0.1.6",
"author": {
"name": "Nate Smith"
},
"main": "./index.js",
"dependencies": {
"connect": ">=1 <2",
"mime": ">=0.0.1"
},
"engines": {
"node": "*"
},
"devDependencies": {
"expresso": ">=0.9",
"should": ">=0.3.1"
},
"optionalDependencies": {},
"readme": "# connect-gzip\n\nGzip middleware for [Connect](http://senchalabs.github.com/connect/) on [Node.js](http://nodejs.org). Uses Unix [`gzip`](http://www.freebsd.org/cgi/man.cgi?query=gzip) command to perform compression of dynamic requests or static files. Originally based on implementation included with Connect before version 1.0.\n\n\n## Installation\n\nInstall via npm:\n\n $ npm install connect-gzip\n\n\n## Usage\n\n### gzip.gzip([options])\n\nInclude this middleware to dynamically gzip data sent via `res.write` or `res.end` based on the Content-Type header.\n\n var connect = require('connect'),\n gzip = require('connect-gzip');\n \n connect.createServer(\n gzip.gzip(),\n function(req, res) {\n res.setHeader('Content-Type', 'text/html');\n res.end('<p>Some gzipped HTML!</p>');\n }\n ).listen(3000);\n \n \n // Only gzip css files:\n gzip.gzip({ matchType: /css/ })\n \n // Use maximum compression:\n gzip.gzip({ flags: '--best' })\n\nOptions:\n\n- `matchType` - A regular expression tested against the Content-Type header to determine whether the response should be gzipped or not. The default value is `/text|javascript|json/`.\n- `bin` - Command executed to perform gzipping. Defaults to `'gzip'`.\n- `flags` - Command flags passed to the gzip binary. Nothing by default for dynamic gzipping, so gzip will typically default to a compression level of 6.\n\n\n### gzip.staticGzip(root, [options])\n\nGzips files in a root directory, and then serves them using the default [`connect.static`](http://senchalabs.github.com/connect/middleware-static.html) middleware. Note that options get passed through as well, so the `maxAge` and other options supported by `connect.static` also work.\n\nIf a file under the root path (such as an image) does not have an appropriate MIME type for compression, it will still be passed through to `connect.static` and served uncompressed. Thus, you can simply use `gzip.staticGzip` in place of `connect.static`.\n\n var connect = require('connect'),\n gzip = require('connect-gzip');\n \n connect.createServer(\n gzip.staticGzip(__dirname + '/public')\n ).listen(3000);\n \n \n // Only gzip javascript files:\n gzip.staticGzip(__dirname + '/public', { matchType: /javascript/ })\n\n // Set a maxAge in milliseconds for browsers to cache files\n var oneDay = 86400000;\n gzip.staticGzip(__dirname + '/public', { maxAge: oneDay })\n\nOptions:\n\n- `matchType` - A regular expression tested against the file MIME type to determine whether the response should be gzipped or not. As in `connect.static`, MIME types are determined based on file extensions using [node-mime](https://github.com/bentomas/node-mime). The default value is `/text|javascript|json/`.\n- `bin` - Command executed to perform gzipping. Defaults to `'gzip'`.\n- `flags` - Command flags passed to the gzip binary. Defaults to `'--best'` for staticGzip.\n\n\n## Tests\n\nRun the tests with\n\n expresso test\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 Nate Smith <nate@nateps.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"readmeFilename": "README.md",
"_id": "connect-gzip@0.1.6",
"dist": {
"shasum": "10d98fb74c8421d9ea0f5deaeaefb8e59c3c23fd"
},
"_from": "connect-gzip@0.1",
"_resolved": "https://registry.npmjs.org/connect-gzip/-/connect-gzip-0.1.6.tgz"
}