
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
fetch-cached
Advanced tools
Fetch cache provides a flexible cache wrapper around fetch.
$ npm install --save fetch-cached
What fetch implementation to use and how to cache the data are defined as options. Below is an example using node-fetch and then-redis to cache for 10 minutes.
The cache option is expected to have functions set(key, value)
and get(key)
(returning a Promise that resolves to the value).
restrictions: Response from cache will come with with these props:
ok: true
, url: key
, status: 200
, statusText: 'OK'
,
and functions .json()
and .text()
import nodeFetch from 'node-fetch'
import { createClient } from 'then-redis'
import fetchCached from 'fetch-cached'
const expiry = 600
const redis = createClient()
const fetch = fetchCached{
fetch: nodeFetch,
cache: {
get: (k) => redis.get(k),
set: (k, v) => redis.send('set', [k, v, 'EX', expiry])
}
})
fetch('https://api.github.com')
.then(function(response) {
return response.json()
}).then(function(json) {
console.log(json)
})
FAQs
Fetch with response cache
The npm package fetch-cached receives a total of 78 weekly downloads. As such, fetch-cached popularity was classified as not popular.
We found that fetch-cached demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.