{"id":23919399,"url":"https://github.com/vandium-io/vandium-serverless","last_synced_at":"2025-09-09T14:40:47.317Z","repository":{"id":57390609,"uuid":"58574428","full_name":"vandium-io/vandium-serverless","owner":"vandium-io","description":"vandium plugin for serverless","archived":false,"fork":false,"pushed_at":"2016-07-07T21:06:41.000Z","size":24,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-11T21:05:20.408Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-11T19:27:56.000Z","updated_at":"2017-10-12T17:12:01.000Z","dependencies_parsed_at":"2022-09-17T03:30:41.593Z","dependency_job_id":null,"html_url":"https://github.com/vandium-io/vandium-serverless","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-serverless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-serverless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-serverless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vandium-io%2Fvandium-serverless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vandium-io","download_url":"https://codeload.github.com/vandium-io/vandium-serverless/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248480437,"owners_count":21110937,"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":[],"created_at":"2025-01-05T14:51:47.725Z","updated_at":"2025-04-11T21:06:39.952Z","avatar_url":"https://github.com/vandium-io.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vandium-serverless\n\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![Build Status](https://travis-ci.org/vandium-io/vandium-serverless.svg?branch=master)](https://travis-ci.org/vandium-io/vandium-serverless)\n[![npm version](https://badge.fury.io/js/vandium-serverless.svg)](https://badge.fury.io/js/vandium-serverless)\n\n[Serverless](https://www.serverless.com) plugin allowing you to create new Node.js 4.3 functions automatically wrapped with [vandium](http://vandium.io).\n\n## Features\n\n* Creates Serverless functions pre-wrapped with vanidum\n* Adds HTTP response codes specific to vandium error conditions\n* No need to remember wrap your Serverless functions in vandium manually\n* Easy to use\n* Integrates with Serverless Framework for AWS Lambda\n* Supports Node.js 4.3.2\n\n## Installation\n\n* Install via npm in the root folder of your Serverless project.\n\n```\nnpm install vandium-serverless --save\n```\n\n* Edit your ```s-project.json``` to include the ```vandium-serverless``` plugin.\n\n```json\n{\n  \"name\": \"yourprojectname\",\n  \"custom\": {},\n  \"plugins\": [ \"vandium-serverless\" ]\n}\n```\n\n## Getting Started\n\nRun ```serverless function create``` to create a new function, as you would normally do with Serverless.\n\nWhen prompted to select a runtime for the new function select 'nodejs4.3-vandium'.\n\n```\nServerless: Please, select a runtime for this new Function\n    nodejs4.3\n    python2.7\n  \u003e nodejs4.3-vandium\n    nodejs (v0.10, soon to be deprecated)\n```\n\nYour newly created function is a standard Node.js 4.3 function wrapped with vandium.\n\n```js\n'use strict';\n\nconst vandium = require( 'vandium' );\n\n/*\nvandium.validation( {\n\n    // your validation code here\n    // firstName: vandium.types.string().min( 4 ).max( 80 ).required(),\n    // lastName: vandium.types.string().min( 4 ).max( 80 ).required(),\n    // age: vandium.types.number().integer().min( 0 ).max( 120 )\n});\n*/\n\nmodule.exports.handler = vandium( function( event, context, callback ) {\n\n    // your code goes here\n\n    callback( null, 'Your Vandium wrapped Serverless function ran succesfully!!!' );\n});\n```\nVandium offers features such as input validation, SQL Injection detection, and JWT authentication. For a full list of features and instructions visit the  [vandium](http://vandium.io) project page.\n\n## Packaging\n\nIn order to use the Vandium wrapper, Vandium must be installed as a third party dependency.  The ```require( 'vandium' )``` is already included at the top of the template Lambda function code.  How you handle third party dependencies in your Serverless project is up to you, however here are several options based on the [Serverless documentation](http://docs.serverless.com/docs/function-configuration).\n\n* Create a ```package.json``` file for each Lambda function, and run ```npm install vandium --save``` in each function directory.  This option results in smaller Lambda functions, but multiple ```node_modules``` and ```package.json``` paths to maintain.\n\n* Use the ```package.json``` in the root directory of your Serverless project, and run ```npm install vandium --save``` there.  To use this option you will have to modify the ```handler``` property in the ```s-function.json``` files to include the full path to the function handler starting from the subdirectory in the project root directory.  It will look something like ```functionName/handler.handler``` or ```lib/functionName/handler.handler``` depending on how you store your functions.  This option will result in larger Lambda functions, since everything will be included in the Lambda function packaging, however there will only be one location for all dependencies (```node_modules``` and ```package.json```).\n\n* You can store your dependencies anywhere you decide to place an additional ```node_modules``` and ```package.json```. Just remember your ```handler``` property must include a path starting in the directory where the dependencies are stored. That entire directory will get packaged when your function is deployed.  As an example,\n\n```\nparent\n|\n|-- functionName\n|   |\n|   |-- event.json\n|   |\n|   |-- handler.js\n|   |\n|   +-- s-function.json\n|\n|-- node_modules\n|\n+-- package.json\n```\n\nwould require the handler property in ```s-function.json``` to look like ```\"handler\": \"functionName/handler.handler\"```\n\n## Feedback\n\nWe'd love to get feedback on how you're using vandium-serverless and things we could add 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-serverless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvandium-io%2Fvandium-serverless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvandium-io%2Fvandium-serverless/lists"}