{"_id":"@carneirofc/sammy","_rev":"1-c513e0408c16ccdeb7ac6ebf75406ef8","name":"@carneirofc/sammy","dist-tags":{"latest":"3.1.3"},"versions":{"3.1.0":{"name":"@carneirofc/sammy","version":"3.1.0","main":"dist/index.js","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/carneirofc/sammy.git"},"scripts":{"build":"tsc --project tsconfig.build.json","test":"jest","lint:prettier":"prettier --check .","fix:prettier":"prettier --write ."},"dependencies":{"aws-sdk":"^2.1055.0","change-case":"^4.1.2","get-port":"^5.1.1","node-fetch":"^2.6.7","tmp":"^0.2.1","unzipper":"^0.10.11","yaml":"^1.10.0"},"devDependencies":{"@tsconfig/node14":"^1.0.1","@types/archiver":"^5.3.1","@types/aws-lambda":"^8.10.71","@types/jest":"^27.0.1","@types/node":"^12.0.0","@types/node-fetch":"^2.5.8","@types/rimraf":"^3.0.2","@types/tmp":"^0.2.0","@types/unzipper":"^0.10.3","archiver":"^5.3.1","jest":"^27.1.0","prettier":"^2.2.1","rimraf":"^3.0.2","ts-jest":"^27.0.5","typescript":"^4.4.2"},"engines":{"node":">=14.0.0"},"_id":"@carneirofc/sammy@3.1.0","gitHead":"4a6c55caa01d61cd428eec6efbb80e354852e78c","types":"./dist/index.d.ts","description":"A Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for local testing of Lambda functions.","bugs":{"url":"https://github.com/carneirofc/sammy/issues"},"homepage":"https://github.com/carneirofc/sammy#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-hqjnILW9XYCto/Ui2eN2FDC8mDxZP0EX4cMep9mSZ8ePSVcFOyIMu7npon1MQAXstIf/8sS4iCxRs0GrBCaUYg==","shasum":"1b7bf9333d689f5e0f447b137e5552feddfc217c","tarball":"https://registry.npmjs.org/@carneirofc/sammy/-/sammy-3.1.0.tgz","fileCount":27,"unpackedSize":52983,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDP6uRce3WyiEXb9ThHBmBO9AxhswdCAx0+aglozNtgVwIhAJB3fG6VtyTbTag/hI32K4/FgXK+PjDBaDPodX+ladxl"}]},"_npmUser":{"name":"carneirofc","email":"claudiofcarneiro@hotmail.com"},"directories":{},"maintainers":[{"name":"carneirofc","email":"claudiofcarneiro@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sammy_3.1.0_1713986887717_0.2875193583736628"},"_hasShrinkwrap":false},"3.1.3":{"name":"@carneirofc/sammy","version":"3.1.3","main":"dist/index.js","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/carneirofc/sammy.git"},"scripts":{"build":"tsc --project tsconfig.build.json","test":"jest","lint:prettier":"prettier --check .","fix:prettier":"prettier --write ."},"dependencies":{"aws-sdk":"^2.1055.0","change-case":"^4.1.2","get-port":"^5.1.1","node-fetch":"^2.6.7","tmp":"^0.2.1","unzipper":"^0.10.11","yaml":"^1.10.0"},"devDependencies":{"@tsconfig/node14":"^1.0.1","@types/archiver":"^5.3.1","@types/aws-lambda":"^8.10.71","@types/jest":"^27.0.1","@types/node":"^12.0.0","@types/node-fetch":"^2.5.8","@types/rimraf":"^3.0.2","@types/tmp":"^0.2.0","@types/unzipper":"^0.10.3","archiver":"^5.3.1","jest":"^27.1.0","prettier":"^2.2.1","rimraf":"^3.0.2","ts-jest":"^27.0.5","typescript":"^4.4.2"},"engines":{"node":">=14.0.0"},"_id":"@carneirofc/sammy@3.1.3","gitHead":"4a6c55caa01d61cd428eec6efbb80e354852e78c","types":"./dist/index.d.ts","description":"A Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for local testing of Lambda functions.","bugs":{"url":"https://github.com/carneirofc/sammy/issues"},"homepage":"https://github.com/carneirofc/sammy#readme","_nodeVersion":"20.12.0","_npmVersion":"10.5.0","dist":{"integrity":"sha512-MIODleaFj7jsM7KD4u8PRkDQtfdHUG8fzJa4uwzY8LZI7xkRGlVVcAEdmWJrrH9SjdIiKukKKCyODsEUE2kaSg==","shasum":"3ffa04a04b03757b13d030013aabc46498058d70","tarball":"https://registry.npmjs.org/@carneirofc/sammy/-/sammy-3.1.3.tgz","fileCount":27,"unpackedSize":52983,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKdkFnXRON+ke8PFO8oOBf23zIyMyeZU1zOfjreg2wfQIhANxns1juK+jkbwlPlGDBykyrX9VKGxlnJF4p3BM+MMnS"}]},"_npmUser":{"name":"carneirofc","email":"claudiofcarneiro@hotmail.com"},"directories":{},"maintainers":[{"name":"carneirofc","email":"claudiofcarneiro@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sammy_3.1.3_1713986934105_0.19017014859763814"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-24T19:28:07.635Z","3.1.0":"2024-04-24T19:28:07.865Z","modified":"2024-04-24T19:28:54.445Z","3.1.3":"2024-04-24T19:28:54.268Z"},"maintainers":[{"name":"carneirofc","email":"claudiofcarneiro@hotmail.com"}],"description":"A Node.js wrapper for [AWS SAM CLI](https://aws.amazon.com/serverless/sam/) for local testing of Lambda functions.","homepage":"https://github.com/carneirofc/sammy#readme","repository":{"type":"git","url":"git+https://github.com/carneirofc/sammy.git"},"bugs":{"url":"https://github.com/carneirofc/sammy/issues"},"license":"Apache-2.0","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 @carneirofc/sammy     # npm\nyarn add -D @carneirofc/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 '@carneirofc/sammy';\n\nconst lambdaSAM = await generateAPISAM({\n  lambdas: {\n    first: {\n      filename: 'lambda.zip',\n      handler: 'handler.handler',\n      runtime: 'nodejs20.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// => Hello World!\n```\n\n## License\n\nApache-2.0 - see [LICENSE](./LICENSE) for details.\n","readmeFilename":"README.md"}