# redis-hmsetex

> hmsetex lua command for redis clients

Latest version **1.1.0** (published 2020-05-04) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-05-04 |
| First published | 2016-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Julian Grinblat |
| Maintainers | perrin4869 |
| Keywords | redis |

## Links

- npm: https://www.npmjs.com/package/redis-hmsetex
- Repository: https://github.com/perrin4869/redis-hmsetex
- Homepage: https://github.com/perrin4869/redis-hmsetex#readme
- Issues: https://github.com/perrin4869/redis-hmsetex/issues
- npm.io page: https://npm.io/package/redis-hmsetex

## 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

- 1.1.0 (latest) — 2020-05-04
- 1.0.1 — 2016-07-09
- 1.0.0 — 2016-05-22

## README

# redis-hmsetex

[![Travis][build-badge]][build]
[![npm package][npm-badge]][npm]
[![Dependency Status][dependency-status-badge]][dependency-status]
[![devDependency Status][dev-dependency-status-badge]][dev-dependency-status]

> hmsetex lua command for redis clients

## DEPRECATED

Since Redis 4.0.0, `hset` has become variadic, so use it instead

## hmsetex redis command

Sets the value of a hash key and updates the expire date at the same time.

```
HMSETEX key 1 firstname walter lastname white
```

In the example above, key `key` expires in 1 second.

## Install

```
$ npm install --save redis-hmsetex
```

## Usage

The easiest usecase is to use with [https://github.com/luin/ioredis](ioredis) as follows:

```js
const Redis = require('ioredis');
const redis = new Redis();
require('redis-hmsetex').install(redis);
```

Additionally, the necessary information is exported:

```js
const Redis = require('ioredis');
const { name, lua, numberOfKeys } = require('hmsetex');
const redis = new Redis();
redis.defineCommand(name, { lua, numberOfKeys });
```

Then, just run like any other command:

```js
redis.hmsetex('some_key', 1, 'firstname', 'walter', 'lastname', 'white');
setTimeout(() => redis.hgetall('somekey'), 1100); // At this point, null is returned
```

## Tests

There are unit tests and integration tests. Needs Node 6+ to run. The integration tests require redis to be installed.

```bash
npm test:unit
npm test:integration
npm test # run both tests
```

## License

See the [LICENSE](LICENSE.md) file for license rights and limitations (MIT).

[build-badge]: https://img.shields.io/travis/perrin4869/redis-hmsetex/master.svg?style=flat-square
[build]: https://travis-ci.org/perrin4869/redis-hmsetex

[npm-badge]: https://img.shields.io/npm/v/redis-hmsetex.svg?style=flat-square
[npm]: https://www.npmjs.org/package/redis-hmsetex

[dependency-status-badge]: https://david-dm.org/perrin4869/redis-hmsetex.svg?style=flat-square
[dependency-status]: https://david-dm.org/perrin4869/redis-hmsetex

[dev-dependency-status-badge]: https://david-dm.org/perrin4869/redis-hmsetex/dev-status.svg?style=flat-square
[dev-dependency-status]: https://david-dm.org/perrin4869/redis-hmsetex#info=devDependencies

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