Azure Function Lightweight frameworks with DI, providing type safe function bindings
Simple starter boilerplate for running Nammatham
Nammatham (นามธรรม in Thai, pronounced /naam ma tham/
, means abstract in Thai) is Azure Function Nodejs Lightweight frameworks with Dependency Injection,
- Azure Function NodeJs : v3.x (
@azure/functions
) - Runtime Version: 4 (Source Code)
- Node.js Versions: 16, 18
Nammatham is a framework that allows you to use Azure Functions with TypeScript and decorators. It provides pre-defined JSON binding objects and utility functions, such as httpTrigger
, to make it easier to create Azure Functions.
Example:
import { AuthorizationLevel, BaseFunction, functionName, httpTrigger } from "nammatham";
import { HttpRequest } from "@azure/functions";
@functionName("GetUsers", httpTrigger(AuthorizationLevel.Anonymous, ["get"]))
export class UserFunction extends BaseFunction {
public override execute(req: HttpRequest): void {
const name = req.query.name;
this.res.send(`hello get user with ${name}`);
}
}
- Provide basic utility for writing Azure Functions
- Only support TypeScript and InversifyJS as the Most Popular Inversion of Control Container and Dependency Injection Approach
- Binding & Trigger Built-in type support
- Http Trigger
- Timer Trigger
- Cosmos DB Trigger
- If your binding type isn't in the list, please use Support custom type
- You can see All available type support or create a PR ;).
- Build Tool Agnostic, this framework just provide the library. It can work with all TypeScript build tool e.g. tsc, esbuild, etc.
Dev
npm run dev
Build
npm run build
Please read the full documentation in the repo
- Thada Wangthammang, Software Engineer, Thailand
- Hot Reload Issues: Azure/azure-functions-core-tools#1239 (comment)