Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "spdy-push", | ||
"description": "", | ||
"version": "0.0.0", | ||
"description": "SPDY Push helper", | ||
"version": "1.0.0", | ||
"author": { | ||
@@ -14,6 +14,8 @@ "name": "Jonathan Ong", | ||
"dependencies": { | ||
"bluebird": "^2.3.2", | ||
"bytes": "^1.0.0", | ||
"compressible": "^1.1.1", | ||
"compressible": "2", | ||
"debug": "*", | ||
"destroy": "^1.0.3", | ||
"mime-types": "^1.0.2", | ||
"mime-types": "2", | ||
"mz": "^1.0.1", | ||
@@ -23,10 +25,7 @@ "native-or-bluebird": "^1.1.0" | ||
"devDependencies": { | ||
"co": "3", | ||
"raw-body": "1", | ||
"mocha": "1", | ||
"supertest": "0", | ||
"spdy": "1", | ||
"spdy-keys": "0", | ||
"istanbul": "0", | ||
"mocha": "1" | ||
"istanbul": "0" | ||
}, | ||
@@ -45,4 +44,5 @@ "scripts": { | ||
"files": [ | ||
"index.js" | ||
] | ||
"lib" | ||
], | ||
"main": "lib" | ||
} |
@@ -5,3 +5,2 @@ | ||
[![NPM version][npm-image]][npm-url] | ||
[![Latest tag][github-tag]][github-url] | ||
[![Build status][travis-image]][travis-url] | ||
@@ -14,2 +13,50 @@ [![Test coverage][coveralls-image]][coveralls-url] | ||
A SPDY Push helper to be used with [spdy](https://github.com/indutny/node-spdy). | ||
- Handles `close` events and file descriptor leaks | ||
- Automatically gzips | ||
- Automatically sets the `content-length` and `content-type` headers if it can | ||
- Supports pushing strings, buffers, streams, and files | ||
## Example | ||
```js | ||
var spdy = require('spdy-push'); | ||
require('spdy').createServer(require('spdy-keys'), function (req, res) { | ||
if (res.isSpdy) { | ||
spdy(res).push('/script.js', { | ||
filename: 'public/script.js', // resolves against CWD | ||
}).catch(function (err) { | ||
console.error(err.stack); // log any critical errors | ||
}) | ||
} | ||
res.statusCode = 204; | ||
res.end(); | ||
}) | ||
``` | ||
## API | ||
### spdy(res).push([path], [options], [priority]) | ||
- `path` is the path of the object being pushed. | ||
Can also be set as `options.path`. | ||
- `priority` is the priority between `0-7` of the push stream | ||
with `7`, the default, being the lowest priority. | ||
Can also be set as `options.priority`. | ||
- `options` are: | ||
- `headers` | ||
- `body` - a `String`, `Buffer`, or `Stream.Readable` body | ||
- `filename` - a path to a file. Resolves against CWD. | ||
Either `options.body` or `options.filename` must be set. | ||
You do not need to set the following headers: | ||
- `content-encoding` | ||
- `content-length` | ||
- `content-type` | ||
[npm-image]: https://img.shields.io/npm/v/spdy-push.svg?style=flat-square | ||
@@ -16,0 +63,0 @@ [npm-url]: https://npmjs.org/package/spdy-push |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10128
5
4
197
1
76
8
2
1
+ Addedbluebird@^2.3.2
+ Addeddebug@*
+ Addedbluebird@2.11.0(transitive)
+ Addedcompressible@2.0.18(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedmime-db@1.52.01.53.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.1.3(transitive)
- Removedcompressible@1.1.1(transitive)
- Removedmime-types@1.0.2(transitive)
Updatedcompressible@2
Updatedmime-types@2