fresh 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HISTORY.md +24 -0
- package/LICENSE +22 -0
- package/README.md +58 -0
- package/package.json +18 -13
- package/Readme.md +0 -56
package/HISTORY.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
0.2.4 / 2014-09-07
|
|
2
|
+
==================
|
|
3
|
+
|
|
4
|
+
* Support Node.js 0.6
|
|
5
|
+
|
|
6
|
+
0.2.3 / 2014-09-07
|
|
7
|
+
==================
|
|
8
|
+
|
|
9
|
+
* Move repository to jshttp
|
|
10
|
+
|
|
11
|
+
0.2.2 / 2014-02-19
|
|
12
|
+
==================
|
|
13
|
+
|
|
14
|
+
* Revert "Fix for blank page on Safari reload"
|
|
15
|
+
|
|
16
|
+
0.2.1 / 2014-01-29
|
|
17
|
+
==================
|
|
18
|
+
|
|
19
|
+
* fix: support max-age=0 for end-to-end revalidation
|
|
20
|
+
|
|
21
|
+
0.2.0 / 2013-08-11
|
|
22
|
+
==================
|
|
23
|
+
|
|
24
|
+
* fix: return false for no-cache
|
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
+
a copy of this software and associated documentation files (the
|
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
+
the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be
|
|
14
|
+
included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# fresh
|
|
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
|
+
HTTP response freshness testing
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
$ npm install fresh
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
var fresh = require('fresh')
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### fresh(req, res)
|
|
24
|
+
|
|
25
|
+
Check freshness of `req` and `res` headers.
|
|
26
|
+
|
|
27
|
+
When the cache is "fresh" __true__ is returned,
|
|
28
|
+
otherwise __false__ is returned to indicate that
|
|
29
|
+
the cache is now stale.
|
|
30
|
+
|
|
31
|
+
## Example
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
var req = { 'if-none-match': 'tobi' };
|
|
35
|
+
var res = { 'etag': 'luna' };
|
|
36
|
+
fresh(req, res);
|
|
37
|
+
// => false
|
|
38
|
+
|
|
39
|
+
var req = { 'if-none-match': 'tobi' };
|
|
40
|
+
var res = { 'etag': 'tobi' };
|
|
41
|
+
fresh(req, res);
|
|
42
|
+
// => true
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
[MIT](LICENSE)
|
|
48
|
+
|
|
49
|
+
[npm-image]: https://img.shields.io/npm/v/fresh.svg?style=flat
|
|
50
|
+
[npm-url]: https://npmjs.org/package/fresh
|
|
51
|
+
[node-version-image]: https://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat
|
|
52
|
+
[node-version-url]: http://nodejs.org/download/
|
|
53
|
+
[travis-image]: https://img.shields.io/travis/jshttp/fresh.svg?style=flat
|
|
54
|
+
[travis-url]: https://travis-ci.org/jshttp/fresh
|
|
55
|
+
[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh.svg?style=flat
|
|
56
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master
|
|
57
|
+
[downloads-image]: https://img.shields.io/npm/dm/fresh.svg?style=flat
|
|
58
|
+
[downloads-url]: https://npmjs.org/package/fresh
|
package/package.json
CHANGED
|
@@ -1,27 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fresh",
|
|
3
|
-
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
|
|
4
3
|
"description": "HTTP response freshness testing",
|
|
5
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.4",
|
|
5
|
+
"author": "TJ Holowaychuk <tj@vision-media.ca> (http://tjholowaychuk.com)",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"fresh",
|
|
9
|
+
"http",
|
|
10
|
+
"conditional",
|
|
11
|
+
"cache"
|
|
12
|
+
],
|
|
6
13
|
"repository": "jshttp/fresh",
|
|
7
14
|
"devDependencies": {
|
|
8
15
|
"istanbul": "0",
|
|
9
16
|
"mocha": "1",
|
|
10
17
|
"should": "3"
|
|
11
18
|
},
|
|
12
|
-
"
|
|
19
|
+
"files": [
|
|
20
|
+
"HISTORY.md",
|
|
21
|
+
"LICENSE",
|
|
22
|
+
"index.js"
|
|
23
|
+
],
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">= 0.6"
|
|
26
|
+
},
|
|
13
27
|
"scripts": {
|
|
14
28
|
"test": "mocha --reporter spec --require should",
|
|
15
29
|
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
|
|
16
30
|
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
|
|
17
|
-
}
|
|
18
|
-
"keywords": [
|
|
19
|
-
"fresh",
|
|
20
|
-
"http",
|
|
21
|
-
"conditional",
|
|
22
|
-
"cache"
|
|
23
|
-
],
|
|
24
|
-
"files": [
|
|
25
|
-
"index.js"
|
|
26
|
-
]
|
|
31
|
+
}
|
|
27
32
|
}
|
package/Readme.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# fresh
|
|
3
|
-
|
|
4
|
-
[![NPM version][npm-image]][npm-url]
|
|
5
|
-
[![Build status][travis-image]][travis-url]
|
|
6
|
-
[![Test coverage][coveralls-image]][coveralls-url]
|
|
7
|
-
[![Dependency Status][david-image]][david-url]
|
|
8
|
-
[![License][license-image]][license-url]
|
|
9
|
-
[![Downloads][downloads-image]][downloads-url]
|
|
10
|
-
|
|
11
|
-
HTTP response freshness testing
|
|
12
|
-
|
|
13
|
-
## fresh(req, res)
|
|
14
|
-
|
|
15
|
-
Check freshness of `req` and `res` headers.
|
|
16
|
-
|
|
17
|
-
When the cache is "fresh" __true__ is returned,
|
|
18
|
-
otherwise __false__ is returned to indicate that
|
|
19
|
-
the cache is now stale.
|
|
20
|
-
|
|
21
|
-
## Example:
|
|
22
|
-
|
|
23
|
-
```js
|
|
24
|
-
var req = { 'if-none-match': 'tobi' };
|
|
25
|
-
var res = { 'etag': 'luna' };
|
|
26
|
-
fresh(req, res);
|
|
27
|
-
// => false
|
|
28
|
-
|
|
29
|
-
var req = { 'if-none-match': 'tobi' };
|
|
30
|
-
var res = { 'etag': 'tobi' };
|
|
31
|
-
fresh(req, res);
|
|
32
|
-
// => true
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Installation
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
$ npm install fresh
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
[npm-image]: https://img.shields.io/npm/v/fresh.svg?style=flat-square
|
|
42
|
-
[npm-url]: https://npmjs.org/package/fresh
|
|
43
|
-
[github-tag]: http://img.shields.io/github/tag/jshttp/fresh.svg?style=flat-square
|
|
44
|
-
[github-url]: https://github.com/jshttp/fresh/tags
|
|
45
|
-
[travis-image]: https://img.shields.io/travis/jshttp/fresh.svg?style=flat-square
|
|
46
|
-
[travis-url]: https://travis-ci.org/jshttp/fresh
|
|
47
|
-
[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh.svg?style=flat-square
|
|
48
|
-
[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master
|
|
49
|
-
[david-image]: http://img.shields.io/david/jshttp/fresh.svg?style=flat-square
|
|
50
|
-
[david-url]: https://david-dm.org/jshttp/fresh
|
|
51
|
-
[license-image]: http://img.shields.io/npm/l/fresh.svg?style=flat-square
|
|
52
|
-
[license-url]: LICENSE
|
|
53
|
-
[downloads-image]: http://img.shields.io/npm/dm/fresh.svg?style=flat-square
|
|
54
|
-
[downloads-url]: https://npmjs.org/package/fresh
|
|
55
|
-
[gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
|
|
56
|
-
[gittip-url]: https://www.gittip.com/jonathanong/
|