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

storage-logger

v0.2.3

Published

storage-logger

Readme

This module will be responsible for uploading the incoming logs, to a storage(S3), in a desired format. In our case, to the format that Redshift will expect.

The module will upload to storage the:

  1. formated version of the log.
  2. original version of the log.

The log will be written to disk before they will be uploaded to storage. A new log file will be created on every new date (configured). And when ever log size exceed the limit (configured).

After the logs are uploaded, the files will be moved in to an archive folder (unless you will configured differently) If the logs fail to upload, the files will be moved in to an errors-archive folder (unless you will configured differently)

The module comes with the following API: write(dataObjectOrJson) store(configurationFileOrObject) configure(configurationFileOrObject)

The module can be configured with the following json file:

{ "datafile" : "/path/to/data.log", [optional, default to ../storage-logger/data.log]

"origfile"			: "/path/to/orig.log", 					[optional, default to ../storage-logger/orig.log]

"archiveDir"     	: "/path/to/archive",  					[optional, default to ../storage-logger-archive]

"errorsDir"       	: "/path/to/archive-errors",  			[optional, default to ../storage-logger-archive-errors]

"archive"         	: true,  								[optional, default to true]

"archive_errors"  	: true,  								[optional, default to true]

"sizeLimit"			: "5000",  								[optional, default to true] 

"datePattern"		: "yyyy-MM-dd",  						[optional, default to yyyy-MM-dd]

"delimiter"			: ",",  								[optional, default to ',']

"event_schema": {
	"input_key1" 		: 	{ "name" : "output_key1", 	"type" : "string" },
	"input_key2" 		: 	{ "name" : "output_key2", 	"type" : "timestamp", "format" : "YYYY-MM-DD HH:mm:ss", "required": true },
	"input_key3" 		: 	{ "name" : "output_key2", 	"type" : "bool" },
	"input_key4" 		: 	{ "name" : "output_key3", 	"type" : "number" }
},

"aws": {
	"access_key" : "XXXXXXXXXXXXXXXXXX",
	"secret_key" : "XXXXXXXXXXXXXXXXXX",
	"bucket" : "path.to.s3.bucket"
}

}

As you can see the event_schema has a very detailed structure. For each "input_entry" there is a field object, that describe the:

  1. output_key (must).
  2. type (optional). Will help for the module to ensure the log is valid
  3. required (optional). If the field is required, but it missing or it's not valid, the log will be not wirtten and the data will be return to the sender. (otherwise null will be returned).

The configuration has been designed to fail fast, so if you will make error in the conf file it will fail.

After been that said... i have i have NO bugs :)