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

serverlessify

v0.6.2

Published

Utility to simulate AWS Lambda event sources and write a server for Serverless functions

Downloads

8

Readme

Serverlessify CircleCI

A tool to put back the server in Serverless functions!

Do you wanted to deploy your NodeJS AWS Lambda with Serverless but then you have been told:

Well, you should just start with a monolith and broke it up in microservices later...

We have got you covered! Use Serverlessify to write a server which serves Serverless lambdas as if they were on AWS. Later, actually deploying your lamndas with Serverless will just be one command away.

Usage

See Serverlessify Starter Kit for a full working usage example.

Install serverlessify with:

npm install --save serverlessify

Configure serverlessify and use it:

const serverlessify = require('serverlessify');
const sls = serverlessify({ http, authorizers });
sls(
  { ... }, // Serverless configuration object
  { ... }  // Handlers
);

Options

For the moment, only http events are supported

  • http: (required) an map with http event handler configuration:

    • eventHandler: (required) An Express app instance that will be configured to work like AWS API Gateway for the Serverless funcitons that has an http event source.
    • getPrincipalIdFromReq: a function that should return a string sent to the lambda handler as principalId. The function will recive the http req parameter.
    • wrapLambda: a function that will be called with a lambda function as parameter. A new function should be returned with should in turn call the given lamnda. This is useful if common logic like error handling or promise lambdas should be added to all http handle lambdas.
    • authorizers: a map of global authorizers that will be available to Serverless http event authorizer configuration as arns
    • authorizersCacheSet a function({key, value, ttl}, cb) used to set an entry in a custom cache to save calls to the authorizer. ttl defaults to 300 (ms) and should be used to invalidate the cache if a authorizersCacheGet is received after that time. The callback cb should be called after the cache has been set.
    • authorizersCacheGet a function(key, cb) used to retireve a cached item. This function should call the callback with a falsy value if there is no cache for the given key or if the cache item is expired. The callback is a function(error, value).