@christopheranderson-personal/azure-functions-typescript-project

v0.0.2
Decorator based project for Azure Functions in TypeScript
azure-functions typescript

Azure Functions TypeScript Project

Define your Functions and their configuration entirely in a single library.

import { Binding, FunctionHost, Fx, HttpTrigger, HttpTriggerBinding, IBinding, IFunctionConfig, } from "azure-functions-typescript-project";

class MyFunc {
    private myhttp(context: Context, @HttpTrigger("req") req: any) {
        context.log("I'm an http function");
        context.done();
    }
}

const host: FunctionHost = new FunctionHost();
host.register(MyFunc);

export default host;

Getting started

  • package.json
{
  "dev-dependencies":{
    "azure-functions-typescript-project":"*"
  },
  "script":"aft build ."
}
  • index.ts
import { Binding, FunctionHost, Fx, HttpTrigger, HttpTriggerBinding, IBinding, IFunctionConfig, } from "azure-functions-typescript-project";

class MyFunc {
    private myhttp(context: Context, @HttpTrigger("req") req: any) {
        context.log("I'm an http function");
        context.done();
    }

    @Fx({
        excluded: true,
        bindings: [{
            name: "item",
            type: "queueTrigger",
            direction: "in",
            connection: "AzureWebJobsStorage",
        }],
    })
    private foobar(context: Context) {
        context.log("foobar");
        context.done();
    }
}

const host: FunctionHost = new FunctionHost();
host.register(MyFunc);

export default host;

License

MIT

npm i @christopheranderson-personal/azure-functions-typescript-project

Metadata

  • MIT
  • >=6.5.0
  • christopheranderson
  • released 2/19/2018

Downloads