Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/functions

Package Overview
Dependencies
Maintainers
7
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/functions - npm Package Compare versions

Comparing version 3.2.0 to 3.5.0-alpha.1

dist/src/index-bundle.js

38

_manifest/manifest.json
{
"Outputs": [
{
"Source": "/package.json",
"AzureArtifactsHash": "047B0D0A20202020226E616D65223A202240617A7572652F66756E6374696F6E7322",
"Sha256Hash": "670393505DAB82072F1827661C85D021DB0E142FBF0A06DB97C688176EAE3BEA"
},
{
"Source": "/README.md",
"AzureArtifactsHash": "042320417A7572652046756E6374696F6E73204E6F64652E6A73204672616D65776F",
"Sha256Hash": "44E4761837769EA456948ABE2E6FC5CE4C963A2A92AB5A2C79283DF5A7EB6AC7"
},
{
"Source": "/LICENSE",

@@ -9,23 +19,23 @@ "AzureArtifactsHash": "04202020204D4954204C6963656E73650D0A0D0A20202020436F7079726967687420",

{
"Source": "/package.json",
"AzureArtifactsHash": "047B0D0A20202020226E616D65223A202240617A7572652F66756E6374696F6E7322",
"Sha256Hash": "7DFC1C696EB8507F0AA41CDC029B0B6C654655DAD624EB858C4F389A4772E1ED"
"Source": "/types/index.d.ts",
"AzureArtifactsHash": "042F2F20436F7079726967687420286329202E4E455420466F756E646174696F6E2E",
"Sha256Hash": "CC610CCD772493AFE767638FAE33C8742BD14A15E380B0C44E6C07A2D157FDE6"
},
{
"Source": "/index.d.ts",
"AzureArtifactsHash": "042F2F20436F7079726967687420286329202E4E455420466F756E646174696F6E2E",
"Sha256Hash": "6CC29D13453DA63B1C229CBD3A2DE14C23F1404E0B2BA63894973543BC03C029"
"Source": "/NOTICE.html",
"AzureArtifactsHash": "043C21444F43545950452068746D6C3E0D0A3C68746D6C206C616E673D22656E223E",
"Sha256Hash": "614B5063DEB4AFE54F15C6C00BAD66338525C7B62628A04E48917C87F37BDFD4"
},
{
"Source": "/README.md",
"AzureArtifactsHash": "0423205479706520646566696E6974696F6E7320666F7220417A7572652046756E63",
"Sha256Hash": "2EF28364DA5CA0161A12B1BC3E2CA792753271CE456B0340D348E30E1F9F8885"
"Source": "/dist/src/index-bundle.js",
"AzureArtifactsHash": "042828293D3E7B76617220743D7B3332373A28742C652C69293D3E7B227573652073",
"Sha256Hash": "ADD48F5551CF6AF1EDB70E5BEF4027ED7696ED30CDCD3C235EDE1E07BB66172C"
}
],
"CloudBuildId": "71779",
"Repo": "https://github.com/Azure/azure-functions-nodejs-worker",
"Branch": "v3.2.0",
"CommitId": "6ad4bfebce122de15a4e0dd4ea9e76cd89d39d60",
"CloudBuildId": "89052",
"Repo": "https://github.com/Azure/azure-functions-nodejs-library",
"Branch": "v3.x",
"CommitId": "c9878d0ec898080cca970b7ec6431c469288c1ad",
"Version": "0.0.1",
"Timestamp": 1653333332
"Timestamp": 1660842686
}
{
"files": [
{
"fileName": "./README.md",
"SPDXID": "SPDXRef-File--README.md-B9D820DDBD380B95C0E7E7D2D1704F27FC538C61",
"fileName": "./dist/src/index-bundle.js",
"SPDXID": "SPDXRef-File--dist-src-index-bundle.js-8862522224A8F908857AB8F49D5C259131AE0071",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "2ef28364da5ca0161a12b1bc3e2ca792753271ce456b0340d348e30e1f9f8885"
"checksumValue": "add48f5551cf6af1edb70e5bef4027ed7696ed30cdcd3c235ede1e07bb66172c"
},
{
"algorithm": "SHA1",
"checksumValue": "b9d820ddbd380b95c0e7e7d2d1704f27fc538c61"
"checksumValue": "8862522224a8f908857ab8f49d5c259131ae0071"
}

@@ -23,12 +23,12 @@ ],

{
"fileName": "./index.d.ts",
"SPDXID": "SPDXRef-File--index.d.ts-08FB297C45C69BE92DD3F1B71E079D55E8488510",
"fileName": "./NOTICE.html",
"SPDXID": "SPDXRef-File--NOTICE.html-4C3DCAD7666072B3C51AA31DBDA07C33FEF1372F",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "6cc29d13453da63b1c229cbd3a2de14c23f1404e0b2ba63894973543bc03c029"
"checksumValue": "614b5063deb4afe54f15c6c00bad66338525c7b62628a04e48917c87f37bdfd4"
},
{
"algorithm": "SHA1",
"checksumValue": "08fb297c45c69be92dd3f1b71e079d55e8488510"
"checksumValue": "4c3dcad7666072b3c51aa31dbda07c33fef1372f"
}

@@ -43,12 +43,50 @@ ],

{
"fileName": "./LICENSE",
"SPDXID": "SPDXRef-File--LICENSE-14CB404E9DE5F2B618AD67DDA908AF2452A4B2B4",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "9fa73cb72fb654d029c9214f0e3eec32c301a0c23be71b50fe3910e61553fa34"
},
{
"algorithm": "SHA1",
"checksumValue": "14cb404e9de5f2b618ad67dda908af2452a4b2b4"
}
],
"licenseConcluded": "NOASSERTION",
"licenseInfoInFiles": [
"NOASSERTION"
],
"copyrightText": "NOASSERTION"
},
{
"fileName": "./types/index.d.ts",
"SPDXID": "SPDXRef-File--types-index.d.ts-2653F72A90F3F09E48AD3135CF231153AFEA57D2",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "cc610ccd772493afe767638fae33c8742bd14a15e380b0c44e6c07a2d157fde6"
},
{
"algorithm": "SHA1",
"checksumValue": "2653f72a90f3f09e48ad3135cf231153afea57d2"
}
],
"licenseConcluded": "NOASSERTION",
"licenseInfoInFiles": [
"NOASSERTION"
],
"copyrightText": "NOASSERTION"
},
{
"fileName": "./package.json",
"SPDXID": "SPDXRef-File--package.json-454808FE5FF4166F60ECD2FBEDE9796044AAF9BD",
"SPDXID": "SPDXRef-File--package.json-4D29E7FF416A0CE124BA2F8DB41EC091F045349E",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "7dfc1c696eb8507f0aa41cdc029b0b6c654655dad624eb858c4f389a4772e1ed"
"checksumValue": "670393505dab82072f1827661c85d021db0e142fbf0a06db97c688176eae3bea"
},
{
"algorithm": "SHA1",
"checksumValue": "454808fe5ff4166f60ecd2fbede9796044aaf9bd"
"checksumValue": "4d29e7ff416a0ce124ba2f8db41ec091f045349e"
}

@@ -63,12 +101,12 @@ ],

{
"fileName": "./LICENSE",
"SPDXID": "SPDXRef-File--LICENSE-14CB404E9DE5F2B618AD67DDA908AF2452A4B2B4",
"fileName": "./README.md",
"SPDXID": "SPDXRef-File--README.md-5D598469E3FE9115C091FFEE847152AF284CC7A8",
"checksums": [
{
"algorithm": "SHA256",
"checksumValue": "9fa73cb72fb654d029c9214f0e3eec32c301a0c23be71b50fe3910e61553fa34"
"checksumValue": "44e4761837769ea456948abe2e6fc5ce4c963a2a92ab5a2c79283df5a7eb6ac7"
},
{
"algorithm": "SHA1",
"checksumValue": "14cb404e9de5f2b618ad67dda908af2452a4b2b4"
"checksumValue": "5d598469e3fe9115c091ffee847152af284cc7a8"
}

@@ -85,4 +123,109 @@ ],

{
"name": "uuid",
"SPDXID": "SPDXRef-Package-600583B2E250C50BD2B3DF84DD1393CD34F6DFD02BEB03AA9530C9FA393BDF96",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "8.3.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/uuid%408.3.0"
}
],
"supplier": "NOASSERTION"
},
{
"name": "fs-extra",
"SPDXID": "SPDXRef-Package-098FADCB01CEB1326E6817ECE1B0C63E28E778027F2600D410523E6FBC45BA03",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "10.0.1",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/fs-extra%4010.0.1"
}
],
"supplier": "Organization: JP Richardson (jprichardson@gmail.com)"
},
{
"name": "graceful-fs",
"SPDXID": "SPDXRef-Package-8B598FBFF684BA9D1CEE650F75CEF0EF36EC523B445379C005D15378AC7C256A",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "4.2.10",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/graceful-fs%404.2.10"
}
],
"supplier": "NOASSERTION"
},
{
"name": "universalify",
"SPDXID": "SPDXRef-Package-990E20CB1EE9CEFE84A73723FDDF02BF285221FA46B1B84F9C3073F48E4B23AA",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "2.0.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/universalify%402.0.0"
}
],
"supplier": "Organization: Ryan Zimmerman (opensrc@ryanzim.com)"
},
{
"name": "long",
"SPDXID": "SPDXRef-Package-044336899C3AD719572161F32356DFBD386B721EFA99ECA36B059C7A2374DA68",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "4.0.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/long%404.0.0"
}
],
"supplier": "Organization: Daniel Wirtz (dcode@dcode.io)"
},
{
"name": "Azure Pipelines Hosted Image win19",
"SPDXID": "SPDXRef-Package-2EC7DF3D857F71BD437D264EB60F888924EB6C43962A25373BEBF759A78279B8",
"SPDXID": "SPDXRef-Package-E2772DFF61D2EC8E54DFB568B245417511ABB3D6DA9246A6D80E0B7BD7E1EF9F",
"downloadLocation": "NOASSERTION",

@@ -96,3 +239,3 @@ "filesAnalyzed": false,

"copyrightText": "NOASSERTION",
"versionInfo": "20220515.1",
"versionInfo": "20220814.1",
"externalRefs": [

@@ -108,7 +251,49 @@ {

{
"name": "Azure Functions Type Definitions",
"name": "jsonfile",
"SPDXID": "SPDXRef-Package-6902D247E9BD5206CA1344524C608D2E4F1ECDF5994CE7CD6FB3A9DA716B6757",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "6.1.0",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/jsonfile%406.1.0"
}
],
"supplier": "Organization: JP Richardson (jprichardson@gmail.com)"
},
{
"name": "fsevents",
"SPDXID": "SPDXRef-Package-EEEEEE210EC980714C74E979E40F36ED52F648607F8D185171F56D224912356C",
"downloadLocation": "NOASSERTION",
"filesAnalyzed": false,
"licenseConcluded": "NOASSERTION",
"licenseInfoFromFiles": [
"NOASSERTION"
],
"licenseDeclared": "NOASSERTION",
"copyrightText": "NOASSERTION",
"versionInfo": "2.3.2",
"externalRefs": [
{
"referenceCategory": "PACKAGE_MANAGER",
"referenceType": "purl",
"referenceLocator": "pkg:npm/fsevents%402.3.2"
}
],
"supplier": "NOASSERTION"
},
{
"name": "Azure Functions Node.js Framework",
"SPDXID": "SPDXRef-RootPackage",
"downloadLocation": "NOASSERTION",
"packageVerificationCode": {
"packageVerificationCodeValue": "bd0f7664507a301b7a3989e82fefdd12d4333cb6"
"packageVerificationCodeValue": "bc570b13dbabe007c677cc05a571bf6be8c9deef"
},

@@ -122,9 +307,11 @@ "filesAnalyzed": true,

"copyrightText": "NOASSERTION",
"versionInfo": "71779",
"versionInfo": "89052",
"supplier": "Organization: Microsoft",
"hasFiles": [
"SPDXRef-File--README.md-5D598469E3FE9115C091FFEE847152AF284CC7A8",
"SPDXRef-File--package.json-4D29E7FF416A0CE124BA2F8DB41EC091F045349E",
"SPDXRef-File--types-index.d.ts-2653F72A90F3F09E48AD3135CF231153AFEA57D2",
"SPDXRef-File--LICENSE-14CB404E9DE5F2B618AD67DDA908AF2452A4B2B4",
"SPDXRef-File--package.json-454808FE5FF4166F60ECD2FBEDE9796044AAF9BD",
"SPDXRef-File--index.d.ts-08FB297C45C69BE92DD3F1B71E079D55E8488510",
"SPDXRef-File--README.md-B9D820DDBD380B95C0E7E7D2D1704F27FC538C61"
"SPDXRef-File--NOTICE.html-4C3DCAD7666072B3C51AA31DBDA07C33FEF1372F",
"SPDXRef-File--dist-src-index-bundle.js-8862522224A8F908857AB8F49D5C259131AE0071"
]

@@ -142,4 +329,39 @@ }

"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-2EC7DF3D857F71BD437D264EB60F888924EB6C43962A25373BEBF759A78279B8",
"relatedSpdxElement": "SPDXRef-Package-EEEEEE210EC980714C74E979E40F36ED52F648607F8D185171F56D224912356C",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-6902D247E9BD5206CA1344524C608D2E4F1ECDF5994CE7CD6FB3A9DA716B6757",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-E2772DFF61D2EC8E54DFB568B245417511ABB3D6DA9246A6D80E0B7BD7E1EF9F",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-8B598FBFF684BA9D1CEE650F75CEF0EF36EC523B445379C005D15378AC7C256A",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-044336899C3AD719572161F32356DFBD386B721EFA99ECA36B059C7A2374DA68",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-098FADCB01CEB1326E6817ECE1B0C63E28E778027F2600D410523E6FBC45BA03",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-600583B2E250C50BD2B3DF84DD1393CD34F6DFD02BEB03AA9530C9FA393BDF96",
"spdxElementId": "SPDXRef-RootPackage"
},
{
"relationshipType": "DEPENDS_ON",
"relatedSpdxElement": "SPDXRef-Package-990E20CB1EE9CEFE84A73723FDDF02BF285221FA46B1B84F9C3073F48E4B23AA",
"spdxElementId": "SPDXRef-RootPackage"
}

@@ -150,9 +372,9 @@ ],

"SPDXID": "SPDXRef-DOCUMENT",
"name": "Azure Functions Type Definitions 71779",
"documentNamespace": "https://sbom.microsoft/1:vB_F0XdED0q5n_yQEwCaWA:kgyn5ihBn0OAEjgv541jlg/10:71779/DrWyZRj_jU6Z9P8MDTN2hA",
"name": "Azure Functions Node.js Framework 89052",
"documentNamespace": "https://sbom.microsoft/1:vB_F0XdED0q5n_yQEwCaWA:kgyn5ihBn0OAEjgv541jlg/145:89052/tjHw10E2VkWoS1_ezVCSMQ",
"creationInfo": {
"created": "2022-05-23T19:15:32Z",
"created": "2022-08-18T17:11:26Z",
"creators": [
"Organization: Microsoft",
"Tool: Microsoft.SBOMTool-2.1.31"
"Tool: Microsoft.SBOMTool-0.1.13"
]

@@ -159,0 +381,0 @@ },

{
"name": "@azure/functions",
"version": "3.2.0",
"description": "Azure Functions types for Typescript",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-functions-nodejs-worker/tree/v3.x/types"
},
"version": "3.5.0-alpha.1",
"description": "Microsoft Azure Functions NodeJS Framework",
"keywords": [
"azure",
"azure-functions",
"serverless",
"typescript"
],
"types": "./index.d.ts",
"author": "Microsoft",
"license": "MIT"
"license": "MIT",
"homepage": "https://github.com/Azure/azure-functions-nodejs-library",
"repository": {
"type": "git",
"url": "https://github.com/Azure/azure-functions-nodejs-library.git"
},
"bugs": {
"url": "https://github.com/Azure/azure-functions-nodejs-library/issues"
},
"main": "dist/src/index-bundle.js",
"types": "types/index.d.ts",
"files": [
"dist/src/index-bundle.js",
"types/index.d.ts",
"LICENSE",
"README.md",
"NOTICE.html",
"_manifest"
],
"scripts": {
"build": "node ./node_modules/typescript/bin/tsc",
"test": "node ./dist/test/index.js",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"updateVersion": "ts-node ./scripts/updateVersion.ts",
"watch": "node ./node_modules/typescript/bin/tsc --watch",
"webpack": "webpack --mode production"
},
"dependencies": {
"fs-extra": "^10.0.1",
"long": "^4.0.0",
"uuid": "^8.3.0"
},
"devDependencies": {
"@types/chai": "^4.2.22",
"@types/chai-as-promised": "^7.1.5",
"@types/fs-extra": "^9.0.13",
"@types/long": "^4.0.2",
"@types/minimist": "^1.2.2",
"@types/mocha": "^9.1.1",
"@types/mock-fs": "^4.13.1",
"@types/mock-require": "^2.0.1",
"@types/node": "^16.9.6",
"@types/semver": "^7.3.9",
"@types/sinon": "^7.0.0",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.12.1",
"@typescript-eslint/parser": "^5.12.1",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-deprecation": "^1.3.2",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-prettier": "^4.0.0",
"globby": "^11.0.0",
"minimist": "^1.2.6",
"mocha": "^9.1.1",
"mocha-junit-reporter": "^2.0.2",
"mocha-multi-reporters": "^1.5.1",
"mock-fs": "^5.1.2",
"mock-require": "^2.0.2",
"prettier": "^2.4.1",
"rimraf": "^2.6.3",
"semver": "^7.3.5",
"shx": "^0.3.3",
"sinon": "^7.0.0",
"ts-node": "^3.3.0",
"typescript": "^4.5.5",
"typescript3": "npm:typescript@~3.7.0",
"typescript4": "npm:typescript@~4.0.0",
"webpack": "^5.72.1",
"webpack-cli": "^4.8.0"
}
}

@@ -1,42 +0,78 @@

# Type definitions for Azure Functions
This package contains type definitions for using TypeScript with Azure Functions. Follow [this tutorial](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-typescript) to create your first TypeScript function.
# Azure Functions Node.js Framework
# Versioning
The version of the package matches the version of the [Node.js worker](https://github.com/Azure/azure-functions-nodejs-worker). It is recommended to install the latest version of the package matching the major version of your worker.
|Worker Version|[Runtime Version](https://docs.microsoft.com/azure/azure-functions/functions-versions)|Support level|Node.js Versions|
|Branch|Status|Support level|Node.js Versions|
|---|---|---|---|
|3|4|GA (Recommended)|16 (Preview), 14|
|2|3|GA|14, 12, 10|
|1|2|GA (Maintenance mode)|10, 8|
|v4.x|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v4.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v4.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v4.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v4.x)|Preview|18 (preview)|
|v3.x (default)|[![Build Status](https://img.shields.io/azure-devops/build/azfunc/Azure%2520Functions/145/v3.x)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=145&branchName=v3.x) [![Test Status](https://img.shields.io/azure-devops/tests/azfunc/Azure%2520Functions/146/v3.x?compact_message)](https://azfunc.visualstudio.com/Azure%20Functions/_build/latest?definitionId=146&branchName=v3.x)|GA (Recommended)|18 (preview), 16, 14|
# Install
Because this package only contains type definitions, it should be saved under `devDependencies`.
## Install
`npm install @azure/functions --save-dev`
```
npm install @azure/functions
```
# Usage
```typescript
import { AzureFunction, Context, HttpRequest } from "@azure/functions";
## Usage
const index: AzureFunction = async function (context: Context, req: HttpRequest) {
context.log('JavaScript HTTP trigger function processed a request.');
if (req.query.name || (req.body && req.body.name)) {
context.res = {
status: "200",
body: "Hello " + (req.query.name || req.body.name)
};
} else {
context.res = {
status: 400,
body: "Please pass a name on the query string or in the request body"
};
}
}
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 Framework for Node.js. This framework package is included by default in [v4.x of the Azure Functions runtime](https://docs.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript), 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.
export { index };
```
### TypeScript:
# Contributing
For a full tutorial, see [how to create your first TypeScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-typescript).
See "Contributing" section on the Node.js worker repo [here](https://github.com/Azure/azure-functions-nodejs-worker#contributing).
1. Specify a main entrypoint in your package.json
```json
"main": "dist/src/index.js"
```
2. Add the following code to your entrypoint file (e.g. `src/index.ts`):
```typescript
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.
For more documentation, see the [TypeScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node#typescript).
### JavaScript
For a full tutorial, see [how to create your first JavaScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node).
1. Specify a main entrypoint in your package.json
```json
"main": "src/index.js"
```
2. Add the following code to your entrypoint file:
```javascript
const func = require('@azure/functions');
func.setup();
```
For more documentation, see the [JavaScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node).
## Contributing
- Clone the repository locally and open in VS Code
- Run "Extensions: Show Recommended Extensions" from the [command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and install all extensions listed under "Workspace Recommendations"
- Run `npm install`
- Run `npm run build`
- Run `npm link`
- Create or open a local function app to test with
- In the local function app:
- Make sure you are calling `func.setup()` somewhere in your app, as described above in the "Usage" section
- Run `npm link @azure/functions`. This will point your app to the local repository for the framework package
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
- `languageWorkers__node__arguments`: `--inspect`
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
- Start the app (i.e. run `func start` or press <kbd>F5</kbd>)
- Back in the framework repository, press <kbd>F5</kbd> and select the process for your running function app
- Before you submit a PR, run `npm run lint` and `npm test` and fix any issues. If you want to debug the tests, switch your [launch profile](https://code.visualstudio.com/docs/editor/debugging) in VS Code to "Launch Unit Tests" and press <kbd>F5</kbd>.
### Code of Conduct
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
### Contributing to type definitions
The type definitions are located in the `types` folder. Any changes should be applied directly to `./types/index.d.ts`. Please make sure to update the tests in `./types/index.test.ts` as well.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc