![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
redis-on-workers
Advanced tools
Connect to your Redis server using cloudflare:sockets
.
This package is designed to work with Cloudflare Workers, but it can also be used in node.js thanks to the implementation of cloudflare:sockets
for node.js.
npm install redis-on-workers
This is the minimal example to connect to a Redis server.
import { createRedis } from "redis-on-workers";
const redis = createRedis("redis://<username>:<password>@<host>:<port>");
await redis.send("SET", "foo", "bar");
const value = await redis.send("GET", "foo");
console.log(value); // bar
// remember to close the connection after use, or use `redis.sendOnce`.
await redis.close();
This is useful if you want to store binary data. For example, you can store protobuf messages in Redis.
import { createRedis } from "redis-on-workers";
const redis = createRedis("redis://<username>:<password>@<host>:<port>");
await redis.sendRaw("SET", "foo", "bar");
const value = await redis.sendRawOnce("GET", "foo");
const decoder = new TextDecoder();
console.log(decoder.decode(value)); // bar
Please install the node.js polyfill for cloudflare:sockets
to use this package in node.js.
npm install @arrowood.dev/socket
createRedis(options: CreateRedisOptions | string): RedisInstance
Create a new Redis client, does NOT connect to the server yet, the connection will be established when the first command is sent.
Or you can start connection immediately by using redis.startConnection()
.
CreateRedisOptions
url
(string): The URL of the Redis server.tls
(boolean): Whether to use TLS. Default: false
.logger
(function): A function to log debug messages.connectFn
(function): Polyfill for cloudflare:sockets
's connect
function if you're using it in node.js. Default: undefined
.FAQs
Connect to your Redis server using cloudflare:sockets
We found that redis-on-workers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.