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

@raysouz/lambda-lowcode-layer

v1.0.10

Published

Framework to easy create lambda low-code integrations

Downloads

4

Readme

@raysouz/lambda-lowcode-layer

About

The @lowcode/lambda-layer is a node.js framework that can accelerate development of lambda integrations on AWS using low-code strategy. Can be used as a dependency of a project or as a lambda layer, granting reuse for all of your lambda functions.

License

The source code authored by us in this repo is licensed under the Apache v2. The full core is open source, but the are some boundary functions that are difficult to publish in a way we can maintain them.

Additional minified JavaScript files and Java libraries are used in this project. All of the licenses are deemed compatible with the Apache 2.0, nothing is GPL or AGPL, due dilgence is performed on all third-party code.

Scope of the Project

@raysouz/lambda-lowcode-layer is a framework that you can use to build your own AWs lambda functions with it.

If you are using a @lowcode/lambda-layer project/framework and have issues or questions about the available services integrations, the issue tracker and discussion in this GitHub project are likely a good place to look.

Using

@raysouz/lambda-lowcode-layer is a easy framework to use, And there are some ways to do this:

  1. You can get the package from npmjs.com using 'npm i @raysouz/lambda-lowcode-layer'
  2. You can refer our public lambda layer on AWS using ARN: arn:aws:lambda:us-east-1:844370664488:layer:lowcode-lambda-layer:1
  3. You can get the release zip file on release layer and create your own AWS lambda layer

The project use a middleware functions to help you create your integration fast.

Example of use

Let's consider you want to build a lambda to integrate an API Gateway resource/method to a DynamoDB table.

In this example you're using:

  1. GET on 'http://myapi.com/v1/users/{username}' route to get information about an specific user
  2. PUT on 'http://myapi.com/v1/users' route to insert a new record of an user

You can choose one of the three options to refer the framework described above, then you can start write your code like this:

const { LowCodeLambda, DynamoResource } = require("@raysouz/lambda-lowcode-layer")

exports.handler = async (event) => {
    const app = new LowCodeLambda();
    const resource = new DynamoResource({
        region: 'sa-east-1', 
        tableName: 'UserTable',
        pk: 'username'
    });

    app.get('/v1/users/{userId}', resource);
    app.put('/v1/users', resource);

    return await app.start(event)
}

You also can user a middleware function to create a custom validation that need to be checked before the action configured. Let's say for any reason you won't allow the GET method return information about an specific username, like raysouz.

You can write the condition, then you can pass the condition through the app.get declaration:

const { LowCodeLambda, DynamoResource } = require("@raysouz/lambda-lowcode-layer")

exports.handler = async (event) => {
    const app = new LowCodeLambda();
    const resource = new DynamoResource({
        region: 'sa-east-1', 
        tableName: 'UserTable',
        pk: 'username'
    });

    let config = {
        condition: (req, args) => {
            if (args.username === 'raysouz') {
                return new Response(501, 'condition has failed');
            }

            return new Response(200);
        }
    };

    app.get('/v1/users/{userId}', resource, condition);
    app.put('/v1/users', resource);

    return await app.start(event)
}

The framework will procede the validation of the condition, and if the validation returns a status code different than 200 your get will not be executed.

Services available for integration

  1. API Gateway
  2. DynamoDB

Node.js Versions

@raysouz/lambda-lowcode-layer was built using Node.js v14