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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@uncloud/debug

v0.0.24

Published

Client libraries for @uncloud/debug - the 10x serverless debugger (email [email protected] to join the private beta)

Downloads

23

Readme

@uncloud/debug

| ⚡️ Fix bugs 10x faster with the first serverless debugger

| uncloud debug is currently in private beta. Sign up for the waitinglist → here

uncloud debug GIF

Features

  • 🔎 Observe what's going on in your lambdas - uncloud debug gives you a holistic view of what's happening in your lambdas - from trigger events to AWS SDK calls
  • ⚡️ Stop raising debug levels - uncloud debug was built to help you understand all the steps that led up to an error instead of just showing you the error itself
  • 👩🏻‍💻 Easy to integrate - Built by software developers for software developers, uncloud debug is a breeze to integrate
  • 🚀 No more Cloudwatch logging - All logs are sent directly to uncloud debug so you don't have to worry about digging through CloudWatch Logs (or spend a fortune on them)
  • ✨ BYOAWS - uncloud debug runs in your own AWS account - no need to worry about data privacy or security

Example

import { DynamoDBClient, UpdateItemCommand } from "@aws-sdk/client-dynamodb";
import { addDebugMiddleware, debug, lambdaWrapper } from "@uncloud/debug";

// Step #1 - Wrap your lambda handler to start recording traces
exports.handler = lambdaWrapper(handler)

async function handler (event: any) {
  const db = new DynamoDBClient({
    region: 'eu-central-1',
  });

  // Step #2 - Add the debug middleware to your AWS SDK v3 clients
  addDebugMiddleware(db)

  const result = await db.send(new UpdateItemCommand({
    TableName: `${process.env.TABLE_NAME}`,
    Key: { id: { S: 'counter' } },
    UpdateExpression: 'ADD #value :value',
    ExpressionAttributeNames: {
      '#value': 'value',
    },
    ExpressionAttributeValues: {
      ':value': { N: '1' },
    },
    ReturnValues: 'UPDATED_NEW'
  }))

  // Step #3 - Add log messages to your traces
  debug('Successfully updated counter', { result })

  return 'OK'
};

Quick reference

lambdaWrapper(handler: Handler): Handler

Takes a lambda handler and returns a wrapped handler that starts recording traces in uncloud debug.

addDebugMiddleware(client: Client)

Takes an AWS SDK v3 client and adds the debug middleware to it. This lets you see AWS SDK calls in your traces.

debug(...args: unknown[])

Adds a log message to the current trace. You can optionally include additional metadata in the log messages by passing in an object as the last argument.

Contact

[email protected]