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

@lafken/queue

v0.6.4

Published

Create and manage Amazon SQS queues in TypeScript with Lambda integration

Readme

@lafken/queue

@lafken/queue simplifies the creation and management of Amazon SQS queues and their integration with AWS Lambda. It provides decorators to define Standard and FIFO queues, configure their properties, and map message attributes and body content directly to your handler parameters.

Installation

npm install @lafken/queue

Configuration

Add the QueueResolver from the @lafken/queue/resolver library to your application configuration.

import { QueueResolver } from '@lafken/queue/resolver';

createApp({
  name: 'awesome-app',
  resolvers: [
    new QueueResolver(),
  ],
  // ...
});

@Queue()
class GreetingQueue {
  // ...
}

const greetingModule = createModule({
  name: 'greeting',
  resources: [
    GreetingQueue
  ]
});

Features

Defining a Queue Resource

Use the @Queue decorator to define a class that contains queue-processing methods.

import { Queue, Standard, Fifo } from '@lafken/queue';

@Queue()
export class NotificationService {
  // ... queue handlers
}

Standard Queues

Use the @Standard decorator to define a handler for a specific Standard SQS queue. You can configure properties such as visibility timeout, delivery delay, and batch size.

@Standard({
  queueName: 'emails',
  visibilityTimeout: 30,
  batchSize: 10,
})
sendEmail(@Event() event: SQSEvent) {
  // Process messages
}

FIFO Queues

Use the @Fifo decorator for FIFO (First-In-First-Out) queues. This ensures that the message order is preserved. You can enable content-based deduplication.

@Fifo({
  queueName: 'orders.fifo',
  contentBasedDeduplication: true,
})
processOrder(@Event() event: SQSEvent) {
  // Process ordered messages
}

Message Handling & Parameter Mapping

@lafken/queue allows you to extract specific data from the SQS message directly into your method parameters using @Param and @Payload.

Accessing Message Body Fields

You can parse the message body (if it's JSON) and inject specific fields.

@Standard({ queueName: 'registrations' })
registerUser(
  @Param({ source: 'body', parse: true, name: 'userId' }) userId: string,
  @Param({ source: 'body', parse: true, name: 'email' }) email: string
) {
  console.log(`Registering user ${userId} with email ${email}`);
}

Accessing Message Attributes

You can also access SQS Message Attributes.

@Standard({ queueName: 'logging' })
logMessage(
  @Param({ source: 'attribute', name: 'TraceId' }) traceId: string,
  @Event() event: any
) {
  // ...
}

Using Payload DTOs

You can use the @Payload decorator to map the entire message body to a typed object.

class UserDto {
  userId: string;
  email: string;
}

@Standard({ queueName: 'users' })
updateUser(@Payload() user: UserDto) {
  // user is fully typed and parsed from the message body
}