# @glidepro/store

> - `npm i @glidepro/store --save`

Latest version **3.0.7** (published 2023-06-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @glidepro/store
pnpm add @glidepro/store
yarn add @glidepro/store
bun add @glidepro/store
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.7 |
| Published | 2023-06-30 |
| First published | 2023-02-04 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | glidepro |

## Links

- npm: https://www.npmjs.com/package/@glidepro/store
- npm.io page: https://npm.io/package/@glidepro/store

## Dependencies (4)

- [date-fns](https://npm.io/package/date-fns.md) ^2.30.0
- [decimal.js](https://npm.io/package/decimal.js.md) ^10.4.3
- [is-plain-object](https://npm.io/package/is-plain-object.md) ^5.0.0
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.363.0

## Recent versions

- 3.0.7 (latest) — 2023-06-30
- 3.0.6 — 2023-04-24
- 3.0.5 — 2023-04-05
- 3.0.4 — 2023-03-11
- 3.0.3 — 2023-03-03
- 3.0.2 — 2023-02-12
- 3.0.1 — 2023-02-10
- 3.0.0 — 2023-02-09
- 2.0.1 — 2023-02-09
- 2.0.0 — 2023-02-08
- 1.0.9 — 2023-02-05
- 1.0.8 — 2023-02-05
- 1.0.7 — 2023-02-05
- 1.0.6 — 2023-02-04
- 1.0.5 — 2023-02-04
- … 2 more at https://npm.io/package/@glidepro/store/versions

## README

## Install

- `npm i @glidepro/store --save`

## Setup

Add or amend your environment file to include:

- `STORE_AWS_SECRET_ACCESS_KEY`
- `STORE_AWS_ACCESS_KEY_ID`
- `STORE_AWS_S3_BUCKET`

## AWS

The library requires permissions to use the following S3 commands:

- `GetObject`
- `PutObject`
- `DeleteObject`

## Usage

All commands return a Promise.

```
const { set, get, hset, hgetall } = require("@glidepro/store");

const test = async () => {
  await set("test:string", "this is a string!");
  await hset("test:hash", { field: "of cows" });

  console.log(await get("test:string")); // this is a string!
  console.log(await hgetall("test:hash")); // { field: 'of cows' }
};

test();
```

## Supported commands

### Generic

- `exists`
- `del`
- `ttl`
- `expire`
- `persist`

### Hash

- `hdel`
- `hgetall`
- `hkeys`
- `hvals`
- `hlen`
- `hincrby`
- `hincrbyfloat`
- `hset`
- `hsetnx`
- `hrandfield`
- `hget`
- `hmget`
- `hexists`
- `hstrlen`

### Set

- `sadd`
- `srem`
- `scard`
- `sismember`
- `smembers`

### String

- `get`
- `set`

## Differences

Note this is not an exhaustive list, yet.

- hashes are stored as whole JSON objects, e.g. `HSET key value` allows `value` to be an array, object, number, string or boolean and it will be stored in that format rather than being forced to string or being required to stringify prior to issuing the command.

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