New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@azure/functions

Package Overview
Dependencies
Maintainers
12
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/functions

Microsoft Azure Functions NodeJS Framework

Source
npmnpm
Version
3.6.0
Version published
Weekly downloads
883K
-52.45%
Maintainers
12
Weekly downloads
 
Created
Source

Azure Functions Node.js Programming Model

BranchStatusSupport levelNode.js Versions
v3.xBuild Status Test StatusGA20, 18

Install

npm install @azure/functions@3

Documentation

Considerations

  • The Node.js "programming model" shouldn't be confused with the Azure Functions "runtime".
    • Programming model: Defines how you author your code and is specific to JavaScript and TypeScript.
    • Runtime: Defines underlying behavior of Azure Functions and is shared across all languages.
  • The programming model version is strictly tied to the version of the @azure/functions npm package, and is versioned independently of the runtime. Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
  • You can't mix the v3 and v4 programming models in the same function app. As soon as you register one v4 function in your app, any v3 functions registered in function.json files are ignored.

Usage

Prior to version 3.5.0, this package only contained TypeScript type definitions. Starting with version 3.5.0 it also contains the underlying Azure Functions Programming Model for Node.js. This package is included by default in v4.x of the Azure Functions runtime, meaning you do not need to include the package in your app. However, there may be cases where you want a specific version of the package, so you can override the default shipped in Azure with the below steps.

TypeScript

  • Specify a main entrypoint in your package.json

    "main": "dist/src/index.js"
    
  • Add the following code to your entrypoint file (e.g. src/index.ts):

    import * as func from '@azure/functions';
    
    func.setup();
    

IMPORTANT NOTE: If you only want this package for the TypeScript type definitions, you may list this package in the "devDependencies" section of your package.json. If you are overriding the default shipped in Azure as described above, the package must be listed in the production "dependencies" section of your package.json.

JavaScript

  • Specify a main entrypoint in your package.json

    "main": "src/index.js"
    
  • Add the following code to your entrypoint file:

    const func = require('@azure/functions');
    
    func.setup();
    

Keywords

azure

FAQs

Package last updated on 06 Jul 2026

Related posts