{"id":21232788,"url":"https://github.com/millihq/sammy","last_synced_at":"2025-07-10T17:31:16.289Z","repository":{"id":39966921,"uuid":"333192139","full_name":"milliHQ/sammy","owner":"milliHQ","description":"A Node.js wrapper for AWS SAM CLI for local testing of Lambda functions.","archived":false,"fork":false,"pushed_at":"2023-01-07T10:41:32.000Z","size":243,"stargazers_count":2,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-21T05:50:47.161Z","etag":null,"topics":["aws","aws-lambda","testing"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/milliHQ.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":"2021-01-26T19:22:24.000Z","updated_at":"2022-10-06T11:12:42.000Z","dependencies_parsed_at":"2023-02-06T23:02:24.883Z","dependency_job_id":null,"html_url":"https://github.com/milliHQ/sammy","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/milliHQ/sammy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliHQ%2Fsammy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliHQ%2Fsammy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliHQ%2Fsammy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliHQ%2Fsammy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milliHQ","download_url":"https://codeload.github.com/milliHQ/sammy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milliHQ%2Fsammy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264618983,"owners_count":23638384,"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":["aws","aws-lambda","testing"],"created_at":"2024-11-20T23:54:43.343Z","updated_at":"2025-07-10T17:31:15.933Z","avatar_url":"https://github.com/milliHQ.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sammy\n\nA Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for local testing of Lambda functions.\n\n## Usage\n\n```sh\nnpm i -D @millihq/sammy     # npm\nyarn add -D @millihq/sammy  # or yarn\n```\n\nAssuming you have a Lambda function with the following content:\n\n```js\n// handler.js\nexports.handler = async function (event, context) {\n  return {\n    isBase64Encoded: false,\n    statusCode: 200,\n    body: 'Hello World!',\n    headers: {\n      'content-type': 'application/json',\n    },\n  };\n};\n```\n\nwhich is packaged into a compressed zip file called `lambda.zip`.\n\n### Run lambda locally with API-Gateway\n\nYou can now start the Lambda function locally and access it through an API-Endpoint:\n\n```ts\nimport * as path from 'path';\n\nimport { generateAPISAM, APISAMGenerator } from '@millihq/sammy';\n\nconst lambdaSAM = await generateAPISAM({\n  lambdas: {\n    first: {\n      filename: 'lambda.zip',\n      handler: 'handler.handler',\n      runtime: 'nodejs16.x',\n      route: '/test',\n      method: 'get',\n    },\n  },\n  cwd: process.cwd(),\n});\n\nconst response = await lambdaSAM.sendApiGwRequest('/test');\nconsole.log(await response.text());\n// =\u003e Hello World!\n```\n\n## License\n\nApache-2.0 - see [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillihq%2Fsammy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmillihq%2Fsammy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmillihq%2Fsammy/lists"}