# redis-script

> A redis lua script manager.

Latest version **0.0.2** (published 2015-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install redis-script
pnpm add redis-script
yarn add redis-script
bun add redis-script
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2015-04-11 |
| First published | 2015-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Roger Madjos |
| Maintainers | botmind |
| Keywords | redis, lua, script |

## Links

- npm: https://www.npmjs.com/package/redis-script
- Repository: git@github.com:rogermadjos/redis-script
- Homepage: https://github.com/rogermadjos/redis-script
- Issues: https://github.com/rogermadjos/redis-script/issues
- npm.io page: https://npm.io/package/redis-script

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2.1.3
- [redis](https://npm.io/package/redis.md) ^0.12.1
- [lodash](https://npm.io/package/lodash.md) ^3.6.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2015-04-11
- 0.0.1 — 2015-04-07

## README

# redis-script
A redis lua script manager with the following features:
+ minimalist api
+ lua script caching
+ automatic reloading of corrupted or deleted script cache

[![Build Status](https://travis-ci.org/rogermadjos/redis-script.svg)](https://travis-ci.org/rogermadjos/redis-script)
[![npm version](https://badge.fury.io/js/redis-script.svg)](http://badge.fury.io/js/redis-script)

## How to install

```
npm install redis-script --save
```

## How to use
```js
var RedisScript = require('redis-script');

//creates a redis connection at port 6379 of `127.0.0.1`
var rs = new RedisScript();

//accepts a redis connection
var rs = new RedisScript(conn);

//add a lua script file
rs.add('name', './lua/filename.lua');

//add a lua script
rs.add('name', 'local keys = redis.call("KEYS", ARGV[1] .. "*");'+
  'return redis.call("MGET", unpack(keys))');

//add all lua script files inside a directory
rs.add('./lua');

//load and execute lua scripts
rs.exec('name', callback);
rs.exec('name', ['key0', 'key1', ..], callback);
rs.exec('name', ['key0', 'key1', ..], ['argv0', 'argv1', ..], callback);
rs.exec('name', 'argv', callback);
rs.exec('name', 'argv0', 'argv1', .. , callback);

```

## License

MIT

---
_Source: https://npm.io/package/redis-script · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
