{"id":23919411,"url":"https://github.com/vandium-io/vandium-node","last_synced_at":"2025-04-12T22:22:55.195Z","repository":{"id":5602753,"uuid":"53436290","full_name":"vandium-io/vandium-node","owner":"vandium-io","description":"AWS Lambda framework for building functions using Node.js for API Gateway, IoT applications, and other AWS events.","archived":false,"fork":false,"pushed_at":"2023-01-05T04:55:39.000Z","size":2089,"stargazers_count":388,"open_issues_count":21,"forks_count":30,"subscribers_count":23,"default_branch":"master","last_synced_at":"2024-04-15T00:14:53.448Z","etag":null,"topics":["api-gateway","aws-lambda","iot","jwt","lambda","serverless"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vandium-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-08T18:43:57.000Z","updated_at":"2024-03-26T13:24:23.000Z","dependencies_parsed_at":"2023-01-13T13:37:02.934Z","dependency_job_id":null,"html_url":"https://github.com/vandium-io/vandium-node","commit_stats":null,"previous_names":[],"tags_count":44,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vandium-io","download_url":"https://codeload.github.com/vandium-io/vandium-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248638608,"owners_count":21137690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-gateway","aws-lambda","iot","jwt","lambda","serverless"],"created_at":"2025-01-05T14:51:53.657Z","updated_at":"2025-04-12T22:22:55.177Z","avatar_url":"https://github.com/vandium-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Vanidum](docs/vandium.png)\n\n[![Build Status](https://travis-ci.org/vandium-io/vandium-node.svg?branch=master)](https://travis-ci.org/vandium-io/vandium-node)\n[![npm version](https://badge.fury.io/js/vandium.svg)](https://badge.fury.io/js/vandium)\n\n[AWS Lambda](https://aws.amazon.com/lambda/details) framework for building functions using [Node.js](https://nodejs.org) for\n[API Gateway](https://aws.amazon.com/api-gateway), IoT applications, and other AWS events.\n\n\n## Features\n* Simplifies writing lambda handlers\n* Automatically verifies event types\n* Powerful input validation\n* Works with [Serverless](https://serverless.com/)\n* JSON Web Token (JWT) verification and validation\n* JWK support for retrieving keys at startup\n* Automatic loading of environment variables from SSM Parameter Store\n* Cross Site Request Forgery (XSRF) detection when using JWT\n* SQL Injection (SQLi) detection and protection\n* Lambda Proxy Resource support for AWS API Gateway\n* Handler initialization for allocating resources\n* Post handler execution to allow deallocation of resources\n* Forces values into correct types\n* Handles uncaught exceptions\n* Promise support\n* Automatically trimmed strings for input event data\n* Low startup overhead\n* AWS Lambda Node.js 12.x\n\n\n## Installation\nInstall via npm.\n\n\tnpm install vandium --save\n\n## Getting Started\n\nVandium creates event specific handlers to reduce the amount of code than one\nneeds to maintain. The following handler code will respond with a message when\nexecuted using the AWS API Gateway with a `GET` request:\n\n```js\nconst vandium = require( 'vandium' );\n\n// handler for an api gateway event\nexports.handler = vandium.api()\n\t\t.GET( (event) =\u003e {\n\n\t\t\t// return greeting\n\t\t\treturn 'Hello ' + event.pathParmeters.name + '!';\n\t\t});\n```\n\nThe framework can process asynchronous responses using promises. The following\ncode returns a User object from a datastore asynchronously:\n\n```js\nconst vandium = require( 'vandium' );\n\n// our datastore access object\nconst Users = require( './users' );\n\n// handler for an api gateway event\nexports.handler = vandium.api()\n\t\t.GET()\n\t\t \t.validation({\n\n\t\t\t\tpathParmeters: {\n\n\t\t\t\t\tname: 'string:min=1,max=100,required'\n\t\t\t\t}\n\t\t\t})\n\t\t\t.handler( async (event) =\u003e {\n\n\t\t\t\t// returns a promise that resolves the User by name\n\t\t\t\treturn await Users.getUser( event.pathParmeters.name );\n\t\t\t});\n```\n\nAdditionally, resources can be closed at the end, success or failure, of the\nhandler. Failure to close resources might cause the lambda function to timeout\nor run for longer than is required. The following code demonstrates closing a\ncache after the handler has been called:\n\n```js\nconst vandium = require( 'vandium' );\n\n// our datastore access object\nconst Users = require( './users' );\n\n// object caching - automatically connects on first access\nconst cache = require( './cache' );\n\n// handler for an api gateway event\nexports.handler = vandium.api()\n\t\t.GET((event) =\u003e {\n\n\t\t\t// returns a promise that resolves the User by name\n\t\t\treturn Users.getUser( event.pathParmeters.name );\n\t\t})\n\t\t.finally( () =\u003e {\n\n\t\t\t// returns a promise that closes the cache connection\n\t\t\treturn cache.close();\n\t\t});\n```\n\nVandium supports the following types of AWS Lambda events:\n\n- API Gateway\n- Cloudformation\n- Cloudwatch\n- Cognito\n- Dynamodb\n- Kinesis\n- Alexa\n- S3\n- Scheduled\n- SES\n- SNS\n\n## Documentation\n\nFor documentation on how to use vandium in your project, please see our [documentation](docs) page.\n\n## Feedback\n\nWe'd love to get feedback on how to make this tool better. Feel free to contact us at `feedback@vandium.io`\n\n## License\n\n[BSD-3-Clause](https://en.wikipedia.org/wiki/BSD_licenses)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvandium-io%2Fvandium-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvandium-io%2Fvandium-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvandium-io%2Fvandium-node/lists"}