New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

url-data-cache

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-data-cache

Cache data from a url request.

latest
Source
npmnpm
Version
1.24.0
Version published
Maintainers
1
Created
Source

url-cache

Cache data from a url request.


  import urlCacheInstance from 'url-data-cache';
  const urlDataCache = urlCacheInstance('my-app');

  // or

  const urlDataCache = require('url-data-cache')('my-app');

  // then


  // get from cache (also delete expired)
  const cachedData = urlDataCache.get(url);
  if(cachedData) return resolve(cachedData);

  // put to cache
  urlDataCache.put(url, htmlData, '1 hour');

Supported time units:

  • n second
  • n seconds
  • n minute
  • n minutes
  • n hour
  • n hours
  • n month
  • n months

where n is a number

FAQs

Package last updated on 19 Jul 2025

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