0.4.0 • Published 2 years ago

@da440dil/js-redis-script v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

js-redis-script

Build Status Coverage Status

Redis script runner.

It optimistically uses EVALSHA to run the script. If script does not exist it retries using EVAL.

Supported Redis clients: node-redis v3 and v4, ioredis v4.

Example usage with node-redis v4:

import { createClient } from 'redis';
import { createScript } from '@da440dil/js-redis-script';

async function main() {
	const client = createClient();
	await client.connect();

	const script = createScript(client, 'return redis.call("ping")');
	const reply = await script.run();
	console.log('PING', reply);
	// Output:
	// PING PONG

	await client.quit();
}

main().catch((err) => {
	console.error(err);
	process.exit(1);
});

Benchmarks

npm run benchmarks
0.4.0

2 years ago

0.3.2

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago