{"id":19042448,"url":"https://github.com/serverless/serverless-helpers-js","last_synced_at":"2025-04-23T22:28:13.544Z","repository":{"id":57356757,"uuid":"47558336","full_name":"serverless/serverless-helpers-js","owner":"serverless","description":"Serverless Helpers Node.Js: An NPM module that provides helper functions for Serverless Modules written in Node.js - ","archived":false,"fork":false,"pushed_at":"2016-09-13T10:37:45.000Z","size":13,"stargazers_count":11,"open_issues_count":4,"forks_count":10,"subscribers_count":28,"default_branch":"master","last_synced_at":"2025-04-12T05:09:42.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://serverless.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serverless.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-07T14:52:47.000Z","updated_at":"2017-09-01T17:04:24.000Z","dependencies_parsed_at":"2022-09-26T16:31:59.623Z","dependency_job_id":null,"html_url":"https://github.com/serverless/serverless-helpers-js","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fserverless-helpers-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fserverless-helpers-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fserverless-helpers-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serverless%2Fserverless-helpers-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serverless","download_url":"https://codeload.github.com/serverless/serverless-helpers-js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249366257,"owners_count":21258334,"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":"2024-11-08T22:37:37.778Z","updated_at":"2025-04-23T22:28:13.526Z","avatar_url":"https://github.com/serverless.png","language":"JavaScript","readme":"Serverless Helpers (Node.js Version)\r\n=================================\r\n[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\r\n\r\n# Currently unmaintained\r\n\r\nAt the moment this library is unmaintained, we're going to take another look at it after we've release V1 of the Framework to evaluate how we should support it in the future.\r\n\r\n###Features\r\n* Helps your modules locate and load Stage Variables that the Serverless framework adds on deployment.\r\n* Allows access to the CF Output variables that you defined in the `s-resources-cf.json` file.\r\n\r\n## CF Output variables\r\nTo have your lambda access the CF output variables you have to give it the `cloudformation:describeStacks` access rights in the lambda IAM role.\r\n\r\nThe CF.loadVars() promise will add all CF output variables to the process'\r\nenvironment as *SERVERLESS_CF_`OutVar name`*. It will add a few ms to the\r\nstartup time of your lambda.\r\n\r\nChange your lambda handler as follows:\r\n\r\n```\r\n// Require Serverless ENV vars\r\nvar ServerlessHelpers = require('serverless-helpers-js');\r\nServerlessHelpers.loadEnv();\r\n\r\n// Require Logic\r\nvar lib = require('../lib');\r\n\r\n// Lambda Handler\r\nmodule.exports.handler = function(event, context) {\r\n  ServerlessHelpers.CF.loadVars()\r\n  .then(function() {\r\n    lib.respond(event, function(error, response) {\r\n      return context.done(error, response);\r\n    });\r\n  })\r\n  .catch(function(err) {\r\n    return context.done(err, null);\r\n  });\r\n};\r\n```\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless%2Fserverless-helpers-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserverless%2Fserverless-helpers-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserverless%2Fserverless-helpers-js/lists"}