fresh 0.2.0 → 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 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
@@ -1,41 +1,6 @@
1
-
2
- # node-fresh
3
-
4
- HTTP response freshness testing
5
-
6
- ## fresh(req, res)
7
-
8
- Check freshness of `req` and `res` headers.
9
-
10
- When the cache is "fresh" __true__ is returned,
11
- otherwise __false__ is returned to indicate that
12
- the cache is now stale.
13
-
14
- ## Example:
15
-
16
- ```js
17
- var req = { 'if-none-match': 'tobi' };
18
- var res = { 'etag': 'luna' };
19
- fresh(req, res);
20
- // => false
21
-
22
- var req = { 'if-none-match': 'tobi' };
23
- var res = { 'etag': 'tobi' };
24
- fresh(req, res);
25
- // => true
26
- ```
27
-
28
- ## Installation
29
-
30
- ```
31
- $ npm install fresh
32
- ```
33
-
34
- ## License
35
-
36
1
  (The MIT License)
37
2
 
38
- Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
3
+ Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
39
4
 
40
5
  Permission is hereby granted, free of charge, to any person obtaining
41
6
  a copy of this software and associated documentation files (the
@@ -54,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
54
19
  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
55
20
  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
56
21
  TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
57
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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,14 +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.0",
6
- "main": "index.js",
7
- "repository": { "type": "git", "url": "https://github.com/visionmedia/node-fresh.git"},
8
- "dependencies": {},
9
- "repository": { "type": "git", "url": "https://github.com/visionmedia/node-fresh.git" },
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
+ ],
13
+ "repository": "jshttp/fresh",
10
14
  "devDependencies": {
11
- "mocha": "*",
12
- "should": "*"
15
+ "istanbul": "0",
16
+ "mocha": "1",
17
+ "should": "3"
18
+ },
19
+ "files": [
20
+ "HISTORY.md",
21
+ "LICENSE",
22
+ "index.js"
23
+ ],
24
+ "engines": {
25
+ "node": ">= 0.6"
26
+ },
27
+ "scripts": {
28
+ "test": "mocha --reporter spec --require should",
29
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should",
30
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should"
13
31
  }
14
32
  }
package/.npmignore DELETED
@@ -1 +0,0 @@
1
- test
package/History.md DELETED
@@ -1,5 +0,0 @@
1
-
2
- 0.2.0 / 2013-08-11
3
- ==================
4
-
5
- * fix: return false for no-cache
package/Makefile DELETED
@@ -1,7 +0,0 @@
1
-
2
- test:
3
- @./node_modules/.bin/mocha \
4
- --reporter spec \
5
- --require should
6
-
7
- .PHONY: test