Skip to content

Commit d2cb03f

Browse files
authored
Update v3 readme for v4 announcement (#68)
1 parent c3271ba commit d2cb03f

File tree

4 files changed

+31
-18
lines changed

4 files changed

+31
-18
lines changed

README.md

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
1-
# Azure Functions Node.js Framework
1+
# Azure Functions Node.js Programming Model
22

33
|Branch|Status|Support level|Node.js Versions|
44
|---|---|---|---|
55
|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|
66
|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, 16, 14|
77

8+
> _**Version 4 is currently in public preview! 🎉✨ Try it out and let us know what you think: <https://aka.ms/AzFuncNodeV4>**_
9+
810
## Install
911

10-
```
12+
```bash
1113
npm install @azure/functions
1214
```
1315

14-
## Usage
16+
## Documentation
17+
18+
- [Azure Functions JavaScript Developer Guide](https://learn.microsoft.com/azure/azure-functions/functions-reference-node?pivots=nodejs-model-v3)
19+
- [Create your first TypeScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-typescript?pivots=nodejs-model-v3)
20+
- [Create your first JavaScript function](https://docs.microsoft.com/azure/azure-functions/create-first-function-vs-code-node?pivots=nodejs-model-v3)
1521

16-
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.
22+
## Considerations
1723

18-
### TypeScript:
24+
- The Node.js "programming model" shouldn't be confused with the Azure Functions "runtime".
25+
- _**Programming model**_: Defines how you author your code and is specific to JavaScript and TypeScript.
26+
- _**Runtime**_: Defines underlying behavior of Azure Functions and is shared across all languages.
27+
- The programming model version is strictly tied to the version of the [`@azure/functions`](https://www.npmjs.com/package/@azure/functions) npm package, and is versioned independently of the [runtime](https://learn.microsoft.com/azure/azure-functions/functions-versions?pivots=programming-language-javascript). Both the runtime and the programming model use "4" as their latest major version, but that is purely a coincidence.
1928

20-
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).
29+
## Usage
30+
31+
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](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.
32+
33+
### TypeScript
2134

2235
1. Specify a main entrypoint in your package.json
36+
2337
```json
2438
"main": "dist/src/index.js"
2539
```
40+
2641
2. Add the following code to your entrypoint file (e.g. `src/index.ts`):
42+
2743
```typescript
2844
import * as func from '@azure/functions';
2945

@@ -32,25 +48,22 @@ For a full tutorial, see [how to create your first TypeScript function](https://
3248

3349
**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.
3450

35-
For more documentation, see the [TypeScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node#typescript).
36-
3751
### JavaScript
3852

39-
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).
40-
4153
1. Specify a main entrypoint in your package.json
54+
4255
```json
4356
"main": "src/index.js"
4457
```
58+
4559
2. Add the following code to your entrypoint file:
60+
4661
```javascript
4762
const func = require('@azure/functions');
4863

4964
func.setup();
5065
```
5166

52-
For more documentation, see the [JavaScript developer guide](https://docs.microsoft.com/azure/azure-functions/functions-reference-node).
53-
5467
## Contributing
5568

5669
- Clone the repository locally and open in VS Code
@@ -61,7 +74,7 @@ For more documentation, see the [JavaScript developer guide](https://docs.micros
6174
- Create or open a local function app to test with
6275
- In the local function app:
6376
- Make sure you are calling `func.setup()` somewhere in your app, as described above in the "Usage" section
64-
- Run `npm link @azure/functions`. This will point your app to the local repository for the framework package
77+
- Run `npm link @azure/functions`. This will point your app to the local repository for the `@azure/functions` package
6578
- Add the following settings to your "local.settings.json" file or configure them directly as environment variables
6679
- `languageWorkers__node__arguments`: `--inspect`
6780
> 💡 Tip: Set `logging__logLevel__Worker` to `debug` if you want to view worker-specific logs in the output of `func start`
@@ -75,4 +88,4 @@ This project has adopted the [Microsoft Open Source Code of Conduct](https://ope
7588

7689
### Contributing to type definitions
7790

78-
The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.
91+
The type definitions are located in the `types` folder. Please make sure to update the tests in `./test/types/index.test.ts` as well.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/functions",
3-
"version": "3.5.0",
3+
"version": "3.5.1",
44
"description": "Microsoft Azure Functions NodeJS Framework",
55
"keywords": [
66
"azure",

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License.
33

4-
export const version = '3.5.0';
4+
export const version = '3.5.1';
55

66
export enum HeaderName {
77
contentType = 'content-type',

0 commit comments

Comments
 (0)