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

create-lambda-express

v1.1.2

Published

Create an Node.js powered AWS Lambda microservice that follows modern practices so you can focus on adding business value. Inspired heavily by create-react-app, create-lambda-express allows you to scaffold out a production-ready microservice that focuses

Downloads

12

Readme

create-lambda-express

Create an Node.js powered AWS Lambda microservice that follows modern practices so you can focus on adding business value. Inspired heavily by create-react-app, create-lambda-express allows you to scaffold out a production-ready microservice that focuses on DX very quickly.

As the name implies, the code generated is an Express application that can be deployed to AWS Lambda. Other notable technologies used are Serverless, Babel and Webpack.

Quick start

Run the following command

yarn create lambda-express hello-lambda

This will install create-lambda-express globally and create a lambda service named hello-lambda. After this you are ready to run

cd hello-lambda
yarn start

After which the server will be started, and your browser will open at http://localhost:3000 and greet you with

{"message":"express server is running succesfully"}

Once you are ready to deploy the service to AWS all you need to do is run

yarn deploy

Prerequisites

Make sure you are running Node6.10+ and have yarn installed. When deploying to AWS Lambda you should also have a credentials file with a default section as described in Configuring the AWS CLI.

Why should you use this?

When I started using AWS Lambda in early 2016, the first thing I did was to use the AWS Console to launch the hello world Node.js snippet. When moving code into production I settled on using serverless after also considering the AWS cli, Claudia, Apex and other options like rolling our own scripts.

Long story short, Serverless helped out a lot, but still, if you only follow the Serverless or AWS recommendations you will miss out on a lot of stuff that will make your life a lot easier. Create-lambda-express comes with batteries included and offers the following advantages out of the box:

  • Decouple your code from AWS Lambda by writing a normal Express application and serve it with aws-serverless-express which acts as a thin layer to proxy calls from Lambda to Express.
  • Use modern javascript (ES2015+) with Babel
  • Support for deploying Dev and prod versions of your service
  • Use babel-preset-env to serve the most optimal code for Node.js 6.10 which runs on AWS Lambda
  • Use local dependencies instead of globally installed packages (like serverless), so everyone in your team uses the same version
  • Local DX: Node.js HMR (Hot module reloading)
  • Local DX: Start the browser automatically when running yarn start
  • Local DX: Automatically choose a different port as the default 3000 when it is taken, or kill the process running there and start anyways

Feedback

If you have any feedback, suggestions or bugs to report, I would love it if you would open an issue to let me know. This package can only get better with your input.

Thank you

Besides all the used package owners / maintainers, a special thank you to Facebook for creating create-react-app, the 'yarn create' command and for bringing HMR in our world (thank you Dan :bowtie:). Also thanks to https://github.com/mhaagens/hot-reload-all-the-things for the best way I could currently find to get HMR on the Node.js side.