{"id":21581556,"url":"https://github.com/thoughtscript/ts_serverless_exp","last_synced_at":"2025-07-16T22:30:28.959Z","repository":{"id":210768876,"uuid":"453272279","full_name":"Thoughtscript/ts_serverless_exp","owner":"Thoughtscript","description":"Experiments with serverless and typescript","archived":false,"fork":false,"pushed_at":"2022-01-29T16:30:46.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-12-04T21:31:02.743Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Thoughtscript.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,"governance":null}},"created_at":"2022-01-29T02:05:01.000Z","updated_at":"2023-12-04T21:31:04.227Z","dependencies_parsed_at":"2023-12-04T21:41:13.599Z","dependency_job_id":null,"html_url":"https://github.com/Thoughtscript/ts_serverless_exp","commit_stats":null,"previous_names":["thoughtscript/ts_serverless_exp"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fts_serverless_exp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fts_serverless_exp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fts_serverless_exp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Thoughtscript%2Fts_serverless_exp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Thoughtscript","download_url":"https://codeload.github.com/Thoughtscript/ts_serverless_exp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226171933,"owners_count":17584910,"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-24T14:12:55.037Z","updated_at":"2024-11-24T14:12:55.590Z","avatar_url":"https://github.com/Thoughtscript.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README\n\n[![](https://img.shields.io/badge/typescript-lang-blue.svg)](https://www.typescriptlang.org/) [![](https://img.shields.io/badge/serverless-3.0.0-red.svg)](https://www.serverless.com/) [![](https://img.shields.io/badge/aws_sdk-2.1.0-gold.svg)](https://github.com/aws/aws-sdk-js) \n\nA few examples to better understand:\n\n1. `serverless` framework (specifically how to invoke functions locally).\n1. Invoke `aws lambda` functions with `serverless` locally.\n1. Some basic `typescript`.\n1. Invoking `serverless` transpiled from `typescript`.\n\n## AWS\n\nA couple examples using [serverless](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local/) framework with `aws-sdk` and typescript (to get more practice with the combination of these).\n\n\u003e If `aws-sdk` is included in handler you may need to use `aws_config.json` or programmatic configuration (even though `serverless` emulates IAM credentials). I tested several scenarios and most required using both some configuration (file/programmatic) and valid credentials.\n\n\u003e **Note:** credentials included in here are dummy/fake.\n\n## Use\n\n```bash\n# Free-standing plain ole JS\ncd handlers\nserverless invoke local -f aws\nserverless invoke local -f aws -p ../events/event.json\n\nserverless invoke local -f example\nserverless invoke local -f example -p ../events/event.json\n\nnode unit_test.js\n```\n\n```bash\n# Invoke transpiled functions\n# From root dir \nserverless invoke local -f aws\nserverless invoke local -f aws -p events/event.json\n\n# Doesn't use aws-sdk\nserverless invoke local -f example\nserverless invoke local -f example -p events/event.json\n```\n\n```bash\n# Execute transpiled scripts\nnode ./built/types/example.type.js\nnode ./built/interfaces/example.interface.js\n```\n\n## Bash\n\nTranspile `typescript` files:\n\n```bash\nnvm use 16.9\nnpm i\nnpm run build\n```\n\nExecute `serverless` functions locally:\n\n```bash\nnpm i serverless -g\n\n# Generic invocation example\nserverless invoke local -f example\n# Generic invocation with event\nserverless invoke local -f example -p event.json\n```\n\n## Super Helpful\n\n1. https://gist.github.com/rstacruz/648cb4dc68a76c761dc9e989832d9a50","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fts_serverless_exp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthoughtscript%2Fts_serverless_exp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthoughtscript%2Fts_serverless_exp/lists"}