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

winston-dynamodb

v0.3.1

Published

A Winston transport for Amazon DynamoDB

Downloads

208

Readme

DynamoDB Transport for Winston

A DynamoDB transport for winston.

Usage

  var winston = require('winston');
  
  require('winston-dynamodb').DynamoDB;
  
  winston.add(winston.transports.DynamoDB, options);

Options

accessKeyId     : your AWS access key id
secretAccessKey : your AWS secret access key
region          : the region where the domain is hosted
useEnvironment  : use process.env values for AWS access, secret, & region
tableName       : DynamoDB table name
dynamoDoc       : if this is set to true, the *meta* parameter will be stored as a subobject using DynamoDB's DocumentClient rather than as a JSON string.

Prerequisite

Make a table with tableName

The table schema depends on how you intend to use it.

Simplest

The table should have

  • hash key: (String) level
  • range key: (String) timestamp

Note: Timestamp has a millisecond resolution. So whether this key setup will work depends on how many log messages you expect.

That is, the uniqueness of level + timestamp means max: 1 log message of a given level per millisecond.

It is nice to have it as a range key for queries.

More Robust

To ensure you can log as many messages as you like, alternatively use:

  • hash key: (String) id (Will be a uuid)
  • range key: (String) timestamp

Using the id as hash ensures that all log items will have unique keys and be included.

Region

Available Regions

  • us-east-1
  • us-west-1
  • us-west-2
  • eu-west-1
  • ap-northeast-1
  • ap-southeast-1
  • ap-southeast-2
  • sa-east-1

AWS Credentials

All of these options are values that you can find from your Amazon Web Services account: 'accessKeyId', 'secretAccessKey' and 'awsAccountId'.

Alternatively, pass in useEnvironment: true and the process.env values will be used.

(Functions in AWS Lambda environment and works with default AWS Credentials Global Configuration .config in other node environments.)

Installation

  $ npm install winston
  $ npm install winston-dynamodb

Author: JeongWoo Chang