npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sqs-ecs-jobs

v1.0.3

Published

Run tasks in ECS from SQS

Readme

Docker NPM Codeship Status for nearst/sqs-ecs-jobs

sqs-ecs-jobs

A worker that consumes jobs from SQS and runs them on predefined ECS tasks.

Has the following qualities:

  • Jobs run at least once (quality of SQS)
  • Each task runs within its own docker container
  • Supports arbitrary data to be passed
  • Simple JSON protocol that can be used anywhere SQS can be called from

It does not:

  • Configure ECS task definitions for you
  • Handle scheduling (please see Scheduling)

Running

You'll need to start two processes:

npm run consume

Which will consume jobs in the SQS queue in the format:

{
  "name": "SomeECSTaskDefinitionName",
  "payload": {
    "arbitrary": 123,
    "data": "here"
  },
  "maxRetries": 1
}

Where payload are maxRetries are optional (will retry infinitely by default). You'll also need to run:

npm run watch

This process will ensure that jobs are run successfully or, if they fail, will ensure they are scheduled to be rerun or moved in to a Dead Letter Queue of your choosing.

Docker

To run in docker:

docker run -i -t nearst/sqs-ecs-jobs npm run consume
docker run -i -t nearst/sqs-ecs-jobs npm run watch

You can pass either command line arguments or provide an environment to docker.

Config

Node-config is used for a flexible config:

{
  "queues": {
    "main": SQS main queue URL,
    "processing": SQS processing queue URL,
    "deadLetter": SQS Dead Letter Queue URL
  },
  "retryBase": Retry backoff multiplier (default 60),
  "maxRetries": Total attempts to get job to run (default 6),
  "clusterName": Cluster to run ECS tasks on
}

Can be configured using command line overrides or environmental variables:

{
  "queues": {
    "main": "QUEUE_URL",
    "processing": "PROCESSING_QUEUE_URL",
    "deadLetter": "DEAD_LETTER_QUEUE_URL"
  },
  "retryBase": "RETRY_BASE",
  "maxRetries": "MAX_RETRIES",
  "clusterName": "CLUSTER_NAME"
}

AWS config

AWS credentials need to be provided in any of their standard ways, but is probably easiest to provide using AWS environmental variables.

Scheduling

Scheduling is not supported natively, however you can utilise Cloudwatch scheduled events, SNS notifications and SQS SNS subscriptions to achieve this without having to run a separate cron daemon. This will have the guarantees of running that Cloudwatch scheduled events, SNS and SQS SNS subscriptions have.

Roadmap

  • Support aggregation of similar tasks within a given timeframe (addition to job's JSON format)
  • Better logging and error notifications
  • Simple support interface to augment AWS console

Contributing

Feel free to contribute by forking and providing a Pull Request. Feel free to raise an issue if you don't know how to tackle a particular problem.