Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
redis-dataloader
Advanced tools
Batching and Caching layer based on the Facebook Dataloader API.
const redis = require('redis').createClient();
const DataLoader = require('dataloader');
const RedisDataLoader = require('redis-dataloader')({ redis: redis });
const redisDataLoader = new RedisDataLoader(
// set a prefix for the keys stored in redis. This way you can avoid key
// collisions for different data-sets in your redis instance.
'redis-key-prefix',
// create a regular dataloader. This should always be set with caching disabled.
new DataLoader(myBatchLoadFunction, { cache: false }),
// The options here are the same as the regular dataloader options, with
// the additional option "expire"
{
// caching here is a local in memory cache
cache: true,
// if set redis keys will be set to expire after this many seconds
// this may be useful as a fallback for a redis cache.
expire: 60
}
);
In general, RedisDataLoader has the same API as the Facebook Dataloader Api, with a few differences.
clear
returns a promise (waits until redis succeeds at deleting the key)clearAll
is not available (redis does not have an efficient way to do this?)prime
will always overwrite the redis cache. It in turn calls prime on the local cache (which does not adjust the cache if the key already exists)null
or a JSON object.FAQs
DataLoader Using Redis as a Cache
The npm package redis-dataloader receives a total of 7,286 weekly downloads. As such, redis-dataloader popularity was classified as popular.
We found that redis-dataloader 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.