{"id":20812565,"url":"https://github.com/superstreamlabs/functions-templates","last_synced_at":"2026-04-20T22:02:21.025Z","repository":{"id":208996079,"uuid":"722578470","full_name":"superstreamlabs/functions-templates","owner":"superstreamlabs","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-14T04:35:10.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T14:53:55.525Z","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/superstreamlabs.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,"roadmap":null,"authors":null}},"created_at":"2023-11-23T12:58:31.000Z","updated_at":"2023-11-25T11:25:00.000Z","dependencies_parsed_at":"2023-12-14T05:42:34.986Z","dependency_job_id":null,"html_url":"https://github.com/superstreamlabs/functions-templates","commit_stats":null,"previous_names":["memphisdev/function-templates","memphisdev/functions-templates","superstreamlabs/functions-templates"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superstreamlabs%2Ffunctions-templates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superstreamlabs%2Ffunctions-templates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superstreamlabs%2Ffunctions-templates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superstreamlabs%2Ffunctions-templates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superstreamlabs","download_url":"https://codeload.github.com/superstreamlabs/functions-templates/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158972,"owners_count":20245669,"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-17T20:55:31.410Z","updated_at":"2025-12-25T23:31:06.472Z","avatar_url":"https://github.com/superstreamlabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Github (6)](https://github.com/memphisdev/memphis/assets/107035359/bc2feafc-946c-4569-ab8d-836bc0181890)](https://www.functions.memphis.dev/)\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://memphis.dev/discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/963333392844328961?color=6557ff\u0026label=discord\" alt=\"Discord\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/memphisdev/memphis/issues?q=is%3Aissue+is%3Aclosed\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-closed/memphisdev/memphis?color=6557ff\"\u003e\u003c/a\u003e \n  \u003cimg src=\"https://img.shields.io/npm/dw/memphis-dev?color=ffc633\u0026label=installations\"\u003e\n\u003ca href=\"https://github.com/memphisdev/memphis/blob/master/CODE_OF_CONDUCT.md\"\u003e\u003cimg src=\"https://img.shields.io/badge/Code%20of%20Conduct-v1.0-ff69b4.svg?color=ffc633\" alt=\"Code Of Conduct\"\u003e\u003c/a\u003e \n\u003cimg alt=\"GitHub release (latest by date)\" src=\"https://img.shields.io/github/v/release/memphisdev/memphis?color=61dfc6\"\u003e\n\u003cimg src=\"https://img.shields.io/github/last-commit/memphisdev/memphis?color=61dfc6\u0026label=last%20commit\"\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \n  \u003cimg width=\"200\" alt=\"CNCF Silver Member\" src=\"https://www.cncf.io/wp-content/uploads/2022/07/cncf-white-logo.svg#gh-dark-mode-only\"\u003e\n  \n\u003c/div\u003e\n \n \u003cb\u003e\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://memphis.dev/pricing/\"\u003eCloud\u003c/a\u003e - \u003ca href=\"https://memphis.dev/docs/\"\u003eDocs\u003c/a\u003e - \u003ca href=\"https://twitter.com/Memphis_Dev\"\u003eX\u003c/a\u003e - \u003ca href=\"https://www.youtube.com/channel/UCVdMDLCSxXOqtgrBaRUHKKg\"\u003eYouTube\u003c/a\u003e\n\u003c/p\u003e\u003c/b\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  \u003ch4\u003e\n\n**[Memphis.dev](https://memphis.dev)** is more than a broker. It's a new streaming stack.\u003cbr\u003e\nMemphis.dev is a highly scalable event streaming and processing engine.\u003cbr\u003e\n\n  \u003c/h4\u003e\n  \n\u003c/div\u003e\n\n## ![20](https://user-images.githubusercontent.com/70286779/220196529-abb958d2-5c58-4c33-b5e0-40f5446515ad.png) About\n\nBefore Memphis came along, handling ingestion and processing of events on a large scale took months to adopt and was a capability reserved for the top 20% of mega-companies. Now, Memphis opens the door for the other 80% to unleash their event and data streaming superpowers quickly, easily, and with great cost-effectiveness.\u003cbr\u003e\n\u003cbr\u003e\nMemphis Functions Is Part of Memphis.dev Platform For Developing Highly-Customizable Event-driven Features and Pipelines By Creating or Employing Serverless Functions.\n\u003cbr\u003e\n\n**This repository is to provide ready-to-use templates for writing Memphis Functions.**\u003cbr\u003e\u003cbr\u003e\nSupported languages: \u003cimg src=\"https://github.com/memphisdev/function-templates/assets/70286779/10d17064-2754-4075-a7bb-16f8fea5e233\" width=\"15px\"\u003e\n | \u003cimg src=\"https://github.com/memphisdev/function-templates/assets/70286779/7ea803d9-22a6-4611-9f1f-d8f850b5b9aa\" width=\"30px\"\u003e | \u003cimg src=\"https://github.com/memphisdev/function-templates/assets/70286779/a5fc1909-d6d2-4831-bf6b-bf405c89f663\" width=\"15px\"\u003e\n\n## How to attach a new function\n1. [Create](https://cloud.memphis.dev) a Memphis.dev Account\n2. Create a new station\n3. Attach a new function\n4. Produce some messages\n\n## How to develop a new private function\nA function comprises code files based on the templates located in this repository and a `memphis.yaml` file contained within a unified directory.\u003cbr\u003e\nThe directory ought to be included in a Git repository that's linked with Memphis.\u003cbr\u003e\nHere is a brief hierarchy diagram of how a compatible function file tree should be constructed: \u003cimg src=\"https://github.com/memphisdev/memphis-dev-functions/assets/70286779/57591907-ce74-454c-a9e3-f7348db88c48\" width=\"50%\" /\u003e\n\u003cbr\u003e\n\n### :rocket: Step-by-step Guide:\n1. Clone or create a new repository (At the moment, support is exclusively available for GitHub.)\n2. Within this repository, establish a fresh directory and initialize it to your chosen programming language\n```bash\nmkdir my-function \u0026\u0026 cd my-function \u0026\u0026 npm init -y\n```\n3. [Copy](https://github.com/memphisdev/function-templates) one of the Memphis Functions templates. For this guide, we chose Node.js\n4. *Required*. Write your logic inside the `eventHandler` block.\u003cbr\u003eIncoming events will be accumulated and dispatched to a function collectively in a batch, therefore the wrapper\n```js\nexports.handler = async (event) =\u003e {\n    return await createFunction(event, eventHandler);\n};\n\n/**\n * https://github.com/memphisdev/memphis.js/tree/functions_wrapper#creating-a-memphis-function\n * @param {Uint8Array} payload \n * @param {Object} headers \n * @param {Object} inputs \n * @returns {Object} \n */\nfunction eventHandler(payload, headers, inputs) {\n    // Handle event here\n\n    // A short example of converting the payload to a json object and returning it as an Uint8Array\n    const decodedPayload = payload.toString('utf-8');\n    const asJson = JSON.parse(decodedPayload);\n\n    return {\n        processedMessage: Buffer.from(JSON.stringify(asJson), 'utf-8'),\n        processedHeaders: headers\n    };\n}\n```\nMessages will return to the Memphis Station in a batch as well.\u003cbr\u003e\n5. *Required*. Add or modify the `memphis.yaml` file based on the following template:\n```yaml\nfunction_name:        #Required. Must be equal to the directory name\nruntime:              #Required. [go | nodejs | nodejs16.x | nodejs18.x | python3.8 | python3.9 | python3.10 | python3.11]\ndependencies:         #The file name contains the list of dependencies the function making use of - default to [requirements.txt(python) / go.mod(go) / package.json (nodes)]\nhandler:              #Required for node.js/Python only. The name of the function's entry point - \u003cfile name\u003e.\u003cfunction name\u003e - for example, if your function is called 'handler' and written inside 'main.py', the handler should be main.handler\ntags:                 #List of tags\n  - tag: json\n  - tag: dev\ninputs:               #list of input fields that will be injected into your function per attachment\n  - name: timestamp\ndescription:          #Description\n```\n6. *Optional*. Add a README file to describe your function so others will know what to do :)\n7. Connect the designated repository with your Memphis account\n8. `my-function` should be available through the Functions main page or a station\n\n## How to develop a new public function\n1. Fork https://github.com/memphisdev/memphis-dev-functions\n2. Add your function's directory, including `memphis.yaml` file\n3. Create a PR\n4. The addition of the new function will take place following a thorough review and subsequent approval\n5. Get your swag pack! 😍\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperstreamlabs%2Ffunctions-templates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperstreamlabs%2Ffunctions-templates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperstreamlabs%2Ffunctions-templates/lists"}