Sha256: 99cdd0daedca1a77e8b4b2eae356c61b315a0f85d893cc629852396b1e0c1b4a

Contents?: true

Size: 1.36 KB

Versions: 16

Compression:

Stored size: 1.36 KB

Contents

# fresh

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

HTTP response freshness testing

## Installation

```
$ npm install fresh
```

## API

```js
var fresh = require('fresh')
```

### fresh(req, res)

 Check freshness of `req` and `res` headers.

 When the cache is "fresh" __true__ is returned,
 otherwise __false__ is returned to indicate that
 the cache is now stale.

## Example

```js
var req = { 'if-none-match': 'tobi' };
var res = { 'etag': 'luna' };
fresh(req, res);
// => false

var req = { 'if-none-match': 'tobi' };
var res = { 'etag': 'tobi' };
fresh(req, res);
// => true
```

## License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/fresh.svg
[npm-url]: https://npmjs.org/package/fresh
[node-version-image]: https://img.shields.io/node/v/fresh.svg
[node-version-url]: http://nodejs.org/download/
[travis-image]: https://img.shields.io/travis/jshttp/fresh/master.svg
[travis-url]: https://travis-ci.org/jshttp/fresh
[coveralls-image]: https://img.shields.io/coveralls/jshttp/fresh/master.svg
[coveralls-url]: https://coveralls.io/r/jshttp/fresh?branch=master
[downloads-image]: https://img.shields.io/npm/dm/fresh.svg
[downloads-url]: https://npmjs.org/package/fresh

Version data entries

16 entries across 16 versions & 4 rubygems

Version Path
lanes-0.8.0 node_modules/fresh/README.md
blackboard-3.1.9 lib/site_template/node_modules/fresh/README.md
webpack_rails-2.0.1 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-2.0.0 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.3.1 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.3.0 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.2.2 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.2.1 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.2.0 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.1.1 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.1.0 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.0.1 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
webpack_rails-1.0.0 lib/webpack_rails/node_modules/express/node_modules/fresh/README.md
gulp_assets-1.0.0.pre.5 template/node_modules/webpack-dev-server/node_modules/express/node_modules/fresh/README.md
gulp_assets-1.0.0.pre.4 template/node_modules/webpack-dev-server/node_modules/express/node_modules/fresh/README.md
gulp_assets-1.0.0.pre.3 template/node_modules/webpack-dev-server/node_modules/express/node_modules/fresh/README.md