Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fresh

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fresh

HTTP response freshness testing

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27M
decreased by-9.9%
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 10 Jun 2012

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc