Code Monkey home page Code Monkey logo

faaskit's Introduction

FaaSKit

npm version

A lightweight functional middleware framework for AWS lambda that stays out of your way and lets you build kick-ass, composable middleware for your lambdas.

Zero dependencies. Functional interface. Reusable code.

Table of Contents

Installation

To use faaskit in your nodejs project,

yarn add @faaskit/core

or

npm i @faaskit/core

@faaskit/core has no dependencies itself (peer or otherwise), so that's it!

Project Purpose

The goal of this project is to provide a very thin middleware framework for functions as a service. Without a well-established middleware pattern, too many bad habits can fossilize from one-off functions into bad middleware. This library provides a compose function for creating coposition-style middleware and wrapping around a handler without having deeply nested code. This function wrapping pattern allows explicitly definied, functional and onion-style (a well-established style) middleware. @faaskit/core also builds on the basic compose function, offering a few patterns that the author(s) have seen in the wild for rapid customization.

Too many middlework frameworks enforce bad designs and opinions onto their users. faaskit doesn't impose much at all and it stays out of your way once you define your stack.

Packages

FaasKit provides a number of small packages so developers can easily pick and choose features and middleware which are applicable to their use case. The packages are organized using the following naming scheme:

  • adapter-<name>: Adapter packages are used for changing the structure of the call site. These are useful for hooking up FaasKit to existing systems in a variety of ways. Including different function runtimes, different middleware stacks or existing legacy functions.
  • middleware-<name>: Middleware packages are used to provide some common middleware functionality. They typically identify their use case in the name of the middleware. These middleware are common patterns and expected workflow that have already been established and should be easy to use just by installing the package and composing the middleware into a middleware stack.
  • <name>: Common goal packages are named without any prefix and are designed around a common goal of middleware. For example, the http package defines a number of utility functions, middleware, contexts and adapters which help anyone using http and will be used by other external packages including middleware-<name> packages and adapter-<name> packages. Typically these packages are foundational and used by middleware authors to create a consistent experience between FaaS platforms.

faaskit's People

Contributors

davidjfelix avatar dependabot-preview[bot] avatar dependabot[bot] avatar with-heart avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

faaskit's Issues

Add keywords

Help people find this repository by adding keywords to the github repo and to the package.json

Convert to code climate

Codecov is having issues with multiple packages. I want to convert this project to use code climate.

  • Make changes to workflow
  • Shut off codecov
  • Add extensions to work with github pull requests and projects
  • Install the browser plugin and make sure it makes sense
  • Spawn tickets when it complains about complexity

CORS Middleware

There should be a simple middleware for enabling cors on APIs.

Fix README

The README should be more helpful and welcoming. Right now it sucks and I hate projects with sucky READMEs

  • Provide better usage documentation for people just using it as-is.
  • Provide expanded section for additional middleware authors.
  • Provide documentation for providing full middleware stacks
  • Provide documentation for providing partial middleware stacks
  • Table of contents
  • Installation details
  • Basic usage example
  • Add API documentation for existing middleware types
  • Get philosophical with it. Short explanation of why compose is awesome and what benefit this gives you over how most people deal with middleware. Maybe a longer explanation towards the bottom
  • Ensure README for each package is descriptive for NPM
  • Ensure main README demonstrates compositions across full project
  • Fix README to be correct name in each repo
  • Fix badges and links to point to correct NPM and builds

Make provided middlewares immutable by default

Currently, it is possible to provide a function which mutates the request object, I'd like to make it so that the provided middleware performs a copy and does not allow alteration of the original object.

Affects:

  • Validation Middleware
  • Mapping middleware

Add optional context to timing log function

Timing log may need information about the request or the response, therefore we should provide a copy (see #5) in a context object to the function as an optional second parameter.

I was thinking the structure would be:

{ event: TEvent, result: TResult}

Remove old changelogs

The old changelogs have no relevance toward the newest version and should be removed.

Dependabot couldn't authenticate with registry.npmjs.org

Dependabot couldn't authenticate with registry.npmjs.org.

Dependabot tried to authenticate with the details you previously provided, but authentication failed. If they are no longer valid you will need to provide Dependabot with new credentials.

You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.

View the update logs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.