{"id":26716619,"url":"https://github.com/javascript-studio/studio-lambda","last_synced_at":"2025-10-06T04:44:50.793Z","repository":{"id":217668629,"uuid":"66095513","full_name":"javascript-studio/studio-lambda","owner":"javascript-studio","description":"🚀 A custom lambda execution environment","archived":false,"fork":false,"pushed_at":"2024-08-28T14:58:32.000Z","size":1000,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T01:37:51.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/javascript-studio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-19T16:14:22.000Z","updated_at":"2024-08-28T14:58:36.000Z","dependencies_parsed_at":"2024-01-17T21:14:02.326Z","dependency_job_id":"73650b55-70d9-4934-abd1-b3bf89ccc8d7","html_url":"https://github.com/javascript-studio/studio-lambda","commit_stats":null,"previous_names":["javascript-studio/studio-lambda"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-studio","download_url":"https://codeload.github.com/javascript-studio/studio-lambda/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245873105,"owners_count":20686531,"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-03-27T15:38:05.953Z","updated_at":"2025-10-06T04:44:45.762Z","avatar_url":"https://github.com/javascript-studio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Studio Lambda\n\n🚀 A custom [AWS Lambda][1] execution environment for local testing. Runs\neach Lambda function in it's own process. Integrates with [Studio Gateway][2].\n\n## Usage\n\n```js\nconst Lambda = require('@studio/lambda');\n\nconst lambda = Lambda.create();\nlambda.invoke('some-lambda', { some: 'event' }, callback);\n```\n\n## API\n\n- `lambda = Lambda.create([options])`: Returns a new Lambda controller for\n  the given options.\n  - `base_dir`: The base directory to use. Defaults to the current working\n    directory.\n  - `lambda_path`: The path to the Lambda function. Replaces `${LAMBDA_NAME}`\n    with the Lambda name. Defaults to `functions/${LAMBDA_NAME}/`.\n  - `env`: An object with environment variables to use. Defaults to an empty\n    object.\n  - `config_file`: A JSON file with additional `environment` and `timeout`\n    properties. Defaults to\n    `functions/${LAMBDA_NAME}/function.${AWS_PROFILE}.json`. Placeholders in\n    the form of `${ENV_VAR}` are replaced with the corresponding environment\n    variable.\n  - `timeout`: The default Lambda timeout to use in milliseconds. Defaults\n    to 5 seconds.\n  - `memory`: The default Lambda memory to use in MB. Defaults to 128 MB. This\n    will set `--max-old-space-size` on Lambda processes.\n  - `max_idle`: The idle timeout to use in milliseconds. If a function is\n    not invoked for this time, the process gets destroyed. Defaults to 1 hour.\n- `lambda.invoke(lambda_name, event[, options][, callback])`: Invokes the named\n  Lambda `handle` function. If no callback is given, a promise is returned.\n  These options are supported:\n  - `awsRequestId`: The AWS request ID to use in the Lambda `context`.\n    If a context is given, but one of the above properties is missing, they are\n    added to the context.\n- `lambda.shutdown([options])`: Shut down all processes. These options may be\n  given:\n  - `graceful`: Wait for running instances before closing processes. If this\n    is not set to `true`, all processes are killed immediately.\n- `lambda.stats()`: Returns stats for this lambda instance. Returns an object\n  where the keys are the Lambda function names and each value is an object with\n  these properties:\n  - `instances`: The total number of instances running.\n  - `active`: The number of instances currently handling requests.\n  - `requests`: The total number of requests received.\n\n## Lambda context\n\nLambda function are invoked with `(event, context[, callback])` where the\n`context` has this interface:\n\n- `functionName`: The name of the Lambda function.\n- `invokedFunctionArn`: The function ARN, build from the `AWS_REGION`\n  (defaulting to `us-east-1`), `STUDIO_AWS_ACCOUNT` (defaulting to\n  `000000000000`) and the Lambda function name.\n- `memoryLimitInMB`: The configured memory limit.\n- `awsRequestId`: The AWS request ID, either from `options` or generated.\n- `getRemainingTimeInMillis()`: Returns the remaining time until the Lambda\n  function times out.\n\nIf `callback` is not defined (the lambda handler function has an arity \u003c 3), the function is expected to return a promise.\n\n## Debugging Lambda functions\n\nIf the environment variable `STUDIO_LAMBDA_INSPECT` is set to the name of a\nLambda function, the node process for that function will be called with\n`--inspect` and the timeout value is ignored. This prints a Chrome debugger URL\nto the console. With this setup in place, you can add `debugger` statements to\nplace breakpoints.\n\n[1]: https://aws.amazon.com/lambda/\n[2]: https://github.com/javascript-studio/studio-gateway\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-studio%2Fstudio-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-lambda/lists"}