orionsoft-react-scripts
Version:
Orionsoft Configuration and scripts for Create React App.
59 lines (43 loc) • 1.39 kB
Markdown
var fresh = require('fresh')
```
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.
```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)
[ ]: https://img.shields.io/npm/v/fresh.svg
[ ]: https://npmjs.org/package/fresh
[ ]: https://img.shields.io/node/v/fresh.svg
[ ]: http://nodejs.org/download/
[ ]: https://img.shields.io/travis/jshttp/fresh/master.svg
[ ]: https://travis-ci.org/jshttp/fresh
[ ]: https://img.shields.io/coveralls/jshttp/fresh/master.svg
[ ]: https://coveralls.io/r/jshttp/fresh?branch=master
[ ]: https://img.shields.io/npm/dm/fresh.svg
[ ]: https://npmjs.org/package/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
```
$ npm install fresh
```
```js