Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

lulibrary/LAG-Utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LAG-Utils

A nodeJS package for interacting with AWS services

This package provides wrapper classes for AWS DynamoDB Tables, SNS Topics and SQS Queues

Utils.Topic

This is a wrapper for SNS topics. It is constructed as

let myTopic = new Topic(arn, region)

methods

topic.publish(message) Publishes a message to the topic.

Utils.Queue

A wrapper for SQS queues.

let myQueue = new Queue({
    name: 'my_queue',
    owner: '123456789'
    url: 'https://12345678.sqs.amazaonaws.com/my_queue'
}) // Either the queue URL, or the name and owner are required to send messages to the queue

methods

queue.sendMessage(message) queue.getQueueUrl() Resolve the Queue URL from the name and owner (if set) queue.receiveMessages(max) queue.deleteMessage(receiptHandle) addPending(message) Add a message to the list of pending messages to be sent sendPending() Send all pending messages as a batch

DB

NOTE: This class is not currently in use by any service in the Alma caching stack, and may be removed in the future. Wrapper for DynamoDB.

let myTable = new DB(tableName, region)

methods

db.get(Key) db.delete(Key) db.save(data)

Usage

npm installgit+ssh://git@github.com/lulibrary/LAG-Utils.git#master

const { Queue, Topic, DB } = require('@lulibrary/lag-utils')

Associated Services

There are four services that make up the Alma caching stack. These are:

There are also 3 custom packages on which these depend. These are:

Development

Contributions to this service or any of the associated services and packages are welcome.