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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mattwyskiel/bootstrap-microservice

v0.3.0

Published

A few simple utils that are generally used by all my AWS-based Microservices.

Downloads

20

Readme

Microservice Bootstrapper

A few simple utils that are generally used by all my AWS-based Microservices.

Installation

NPM

npm install --save-dev @mattwyskiel/bootstrap-microservice

Yarn

yarn add --dev @mattwyskiel/bootstrap-microservice

Usage

npx bootstrap-microservice [options] [command] / yarn bootstrap-microservice [options] [command]

CLI to add opinionated common boilerplate to SST-generated TypeScript microservices

Options:
  -V, --version          output the version number
  -h, --help             display help for command

Commands:
  boilerplate [options]
  codeformat [options]
  help [command]         display help for command

Commands

boilerplate

bootstrap-microservice boilerplate [options]

Options:
  -d, --dir <directory>     directory to output folder "lib/" of boilerplate code files in (relative to current working
                            directory) (default: "./")
  -p --project <directory>  root project directory which contains package.json file (default: "./")
  -h, --help                display help for command

This tool adds the following functionality to the libs/ directory

Logger

This library exposes a pre-configured winston logger with the following settings:

  1. When deployed, outputs logs as JSON, including the timestamp, with a default minimum log level of info (can be set using the LOG_LEVEL environment variable)
  2. When running locally (process.env.IS_LOCAL), outputs to the console with the following custom format:
${level.toUpperCase()} - ${message}
${detailIfExists}

For example:

INFO - Incoming Request
{
  "body": {
    "foo": "bar"
  },
  "headers: {
    "x-foo": "bar"
  }
}

And the formatter has logic such that if there is only one field in the details object, then it will just print that.

For example, if the above request details only had the body, the log could come across like the following:

INFO - Request Body
{
  "foo": "bar"
}
Usage
import { logger } from '@mattwyskiel/microservice-boilerplate';

logger.info('This is a log!');

Request Monitoring

This library implements a middy middleware that does the following:

  1. Adds the AWS Request ID to the logs for grouping and searchability.
  2. If the code is deployed, logs the API Gateway proxy requests and responses.
  3. Intercepts all errors and normalizes them for consistent
Usage
import { requestMonitoring } from '@mattwyskiel/microservice-boilerplate';
import middy from '@middy/core';

// define handler

export default middy(handler).use(requestMonitoring());

Amazon API Gateway Helper Types

This library defines some helper types that enable a strongly-typed API Gateway request body.

import { APIGatewayProxyEventV2, APIGatewayProxyResultV2, Handler } from 'aws-lambda';
import { FromSchema } from 'json-schema-to-ts';

export type APIGatewayJSONBodyEvent<S> = Omit<APIGatewayProxyEventV2, 'body'> & {
  body: FromSchema<S>;
};

export type APIGatewayJSONBodyEventHandler<S> = Handler<
  APIGatewayJSONBodyEvent<S>,
  APIGatewayProxyResultV2
>;

The library also exposes a helper function that can send a 'success' JSON response:

import { json } from '@mattwyskiel/microservice-boilerplate';
import { APIGatewayProxyHandlerV2 } from 'aws-lambda';

export const handler: APIGatewayProxyHandlerV2 = event => {
  return json({
    message: `Hello, World! Your request was received at ${event.requestContext.time}.`,
  });
};

codeformat

Usage: bootstrap-microservice codeformat [options]

Options:
  -p --project <directory>  root project directory which contains package.json file (default: "./")
  -h, --help                display help for command

This tool installs eslint and prettier and provides default configs for both, for use in TypeScript projects.