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

@tiqqe/lambda-logger

v1.1.1

Published

Logger for AWS Lambda nodejs.

Readme

CI

A nodejs logger for AWS Lambda

  • Writes logs to stdout/stderr using console.debug|info|warn|error
  • Logs in JSON format (supports both pretty-printed and compact formats)
  • Supports log levels: DEBUG, INFO, WARN, ERROR and OFF
  • Defaults to log level INFO
  • Built using typescript and includes types

Basic example:

import { APIGatewayEvent } from 'aws-lambda';
import { log, LogLevels } from '@tiqqe/lambda-logger';

export const healthCheck = async (event: APIGatewayEvent) => {
  // A standard INFO log message
  log.info('My message');
};
  // Output
  {
    "timestamp": "2020-03-26T14:36:07.345Z",
    "logLevel": "INFO",
    "message": "My message"
  }

Log Levels

The default log level is INFO log.level = LogLevels.INFO;. To show debug messages you need to explicitly set the log.level to DEBUG like this:

// Set loglevel
log.logLevel = LogLevels.DEBUG;
// Write debug log
log.debug('Debugging stuff');
{
  "timestamp": "2020-03-26T14:36:07.345Z",
  "logLevel": "DEBUG",
  "message": "Debugging stuff"
}

Logging extra data

You can add any number of extra properties to the object when logging, like this:

// Write info log
log.info({ message: 'Message', myProp: 'hello', myNestedProp: { subProp: 'something' } });
{
  "timestamp": "2020-03-26T14:36:07.345Z",
  "logLevel": "INFO",
  "message": "Message",
  "myProp": "hello",
  "myNestedProp": {
    "subProp": "something"
  }
}

Mute all logs:

log.level = LogLevels.OFF;

Set log level with environment variable

You can easily set the initial log level by setting the environment variable LOG_LEVEL. This can be useful for setting different log levels in different environments TEST|PROD etc. Use 'OFF', 'DEBUG', 'INFO', 'WARN' or 'ERROR', like this:

LOG_LEVEL: 'DEBUG'

Compact JSON output

By default, logs are pretty-printed for better readability. You can enable compact single-line output by setting the compactPrint option:

// Enable compact printing
log.init({ compactPrint: true });

log.info('My message');
// Output: {"timestamp":"2024-02-13T14:36:07.345Z","logLevel":"INFO","message":"My message"}

// Default pretty printing
log.init({ compactPrint: false });

log.info('My message');
// Output:
// {
//   "timestamp": "2024-02-13T14:36:07.345Z",
//   "logLevel": "INFO",
//   "message": "My message"
// }

Serialize BigInt

By default JSON.stringify will raise a TypeError if an object contains values of the type BigInt. By setting the supportBigIntoption to true they will be serialized to a string + "n". Example BigInt(123) -> "123n".

// Enable support for BigInt
log.init({ supportBigInt: true });

log.info({message: "BigInt supported", bigIntValue: 123n});
// Output:
// {
//   "timestamp": "2025-02-17T14:36:07.345Z",
//   "logLevel": "INFO",
//   "Message": "BigInt supported"
//   "bigIntValue": "123n"
// }



## Release process

Bump the `version` in `package.json` according to [semver](https://semver.org/spec/v2.0.0.html). If we are making a non-breaking change, compared to the last version, the new `version` would go from `0.11.0` to `0.12.0`.