New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

fresh

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fresh

HTTP response freshness testing

0.5.2
latest
Version published
Weekly downloads
35M
0.05%
Maintainers
1
Weekly downloads
 
Created

What is fresh?

The 'fresh' npm package is a HTTP response freshness testing library. It is used to determine whether the response is still 'fresh' in the context of HTTP caching. It checks the request and response headers to decide if the response should be re-used or if a new one needs to be generated.

What are fresh's main functionalities?

Freshness Checking

This feature allows you to check if the HTTP response is still fresh by comparing the request and response headers. If the function returns true, the response is considered fresh.

const fresh = require('fresh');

const reqHeaders = { 'if-none-match': 'some-etag' };
const resHeaders = { 'etag': 'some-etag' };

const isFresh = fresh(reqHeaders, resHeaders);
console.log(isFresh); // true or false

Other packages similar to fresh

FAQs

Package last updated on 14 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts