3.0.7 • Published 11 months ago

@glidepro/store v3.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

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.
3.0.7

11 months ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago