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

faas-local

v0.1.1

Published

A nodejs FaaS container/runner & an optional HTTP server that relays requests to it.

Downloads

32

Readme

FaaS-Local

FaaS-Local is a basic implementation of a Lambda (Function as a Service) container & runner for nodejs functions - suitable for local testing.

Looking at other similar packages now I see that the distinguishing features of this one are:

  • For each request it receives it either forks (childprocess.fork) a new node environment or reuses one created when handling a previous request. I feel this best reproduces the FaaS services it emulates.
  • It has an optional HTTP server (using node's built-in http module) that can receive invocations as HTTP posts (the same way GCP's Function service allows) and feed them to the runtime.

Note that I've titled this 'FaaS-Local' but the package and binary name are all lower-case. (I'm sticking with the term 'FaaS', rather then the much more common 'Lambda' because all but AWS use the term Function rather then Lambda). One of the great things about nodejs FaaS services is that they are available on all the major cloud services providers with only very minor changes need for portability.

Install

npm install -g faas-local  

Usage

As a command line tool

cd [dir of your node package]
faas-local run 
faas-local run -e [event file]  

[event file] is a json text file with an event/request to be submitted to your function; if one is not specified it will use the default event provided in 'eventSample.json'.

faas-local serve

Compatibility

I had this working on Linux (c9.io which was Ubuntu, and then AWS C9) and on Windows 10, but haven't tested more recent versions on Windows.

I've used it with Node 4, 6, and 8 as AWS Lambda has advanced its support. It is currently only being tested with Node v8.10.x.

Implementation Overview

The flow of control thru the files...

faas-local -->
server.js (if 'serve' command specified) -->
http_handler.js -->
lamwrap.js --(childprocess.fork)-->
lamfork_child.js -->
User's Lambda entry point

ToDo

Parameterize the http server

It's currently hardcoded for my use cases.

Replace moment.js

New generation of alternatives (much smaller)...
luxon, date-fns, or dayjs

Alternatives/Similar projects (2018)

I created most of this in 2016, updating it for publishing in 2018-05 (meant to fix this up for publication a long time ago, but got lazy). Now, in the process of finally doing it I see that there are now at least 3 popular projects (I had used node-lambda but was not aware of the others) that include core functionality similar to this package, but which have benefitted from being open source for a long time so they are more developed and much better tested.

But these don't fork a child process (ie. for each lambda instance). Not sure why - isn't that the most suitable method?

Node Lambda

https://github.com/motdotla/node-lambda
I've been using this for uploading my lambda to AWS.

Lambda Wrapper

https://www.npmjs.com/package/lambda-wrapper (16 *, 3000/w)
https://github.com/nordcloud/lambda-wrapper

Lambda Local

https://github.com/ashiina/lambda-local (400 *, 2800/w)
https://www.npmjs.com/package/lambda-local