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

egon

v1.0.0

Published

Crossing CloudWatch Logs streams

Downloads

1

Readme

Egon

Dr. Egon Spengler: There's something very important I forgot to tell you. Dr. Peter Venkman: What? Dr. Egon Spengler: Don't cross the streams. Dr. Peter Venkman: Why? Dr. Egon Spengler: It would be bad. Dr. Peter Venkman: I'm fuzzy on the whole good/bad thing. What do you mean, "bad"? Dr. Egon Spengler: Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light. Dr Ray Stantz: Total protonic reversal. Dr. Peter Venkman: Right. That's bad. Okay. All right. Important safety tip. Thanks, Egon.

There are some situations when you do want to cross the streams, AWS CloudWatch Logs streams in this case.

Installation

$ npm install egon

How to use it

This module combines multiple streams.

var params = {
  logGroupName: 'your-log-group'
};
egon.crossStreams(params, function(err, events) {
  // events contains all events in the streams
  // contained in the specified group
  // in this downloaded batch
}, function(err) {
  // we are done
});

Another example with startTime and endTime.

var params = {
  logGroupName: 'your-log-group',
  startTime: start.getTime(),
  endTime: end.getTime(),
  startFromHead: true
};
egon.crossStreams(params, function(err, events) {
  // events contains all events in the streams
  // contained in the specified group
  // in this downloaded batch
}, function(err) {
  // we are done
});

Running tests

$ npm test

Release notes

1.0.0

As noted by the major update I changed crossStreams signature, introducing a handler that is called for every batch of logs, the second function is called when there are no more logs.

Removed the sorting feature, no more the need to buffer events in memory. Need to rely on an external sorting tool (/usr/bin/sort might help).

0.6.1

Added repository field to package.json

0.6.0

I've made some stupid mistakes while publishing.

0.4.1

Fixes a mutability bad practice that prevented to read the correct events from the streams.

0.4.0

Adds support for startTime and endTime. Logs are buffed in memory.

0.3.0

Implements #1, allowing to pass a parameter object that will be forwarded to the getLogEvents call.