All Products
Search
Document Center

Function Compute (2.0):Overview

Last Updated:Mar 21, 2024

You can use the Node.js framework to write information about runtime environments of functions in Function Compute.

Node.js runtimes

The following table lists the Node.js runtimes that are supported by Function Compute.

Version

Operating system

Architecture

Node.js 20.x (public preview)

Linux (Debian 10)

x86_64

Node.js 18.x (public preview)

Linux (Debian 10)

x86_64

Node.js 16.x

Linux (Debian 9)

x86_64

Node.js 14.x

Linux (Debian 9)

x86_64

Node.js 12.x

Linux (Debian 9)

x86_64

Node.js 10.x

Linux (Debian 9)

x86_64

Node.js 8.x

Linux (Debian 9)

x86_64

Important
  • Function Compute will stop supporting Node.js 4.4 and Node.js 6. For more information, see the End of support for runtimes.

  • Node.js 18.x and Node.js 20.x are supported in the following regions: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), China (Chengdu), China (Hong Kong), Singapore, Australia (Sydney), Malaysia (Kuala Lumpur), Indonesia (Jakarta), and Japan (Tokyo), UK (London), and US (Virginia).

Specify an ECMAScript module as the handler

ECMAScript modules are supported by Function Compute in Node.js 18 and later. For Node.js 16 and earlier versions, Function Compute supports only CommonJS modules.

You can specify an ECMAScript module in one of the following methods:

  • Specify type in the package.json file of a function as module. In this case, all .js files are specified as ECMAScript modules.

  • Use the .mjs file name extension. In this case, .mjs files are regarded as ECMAScript modules, and .js files are still regarded as CommonJS modules. You can mix ECMAScript modules and CommonJS modules by using both the .mjs and .js file extensions. By default, .mjs files are treated as ECMAScript modules and .js files are treated as CommonJS modules.

Node.js built-in modules

In addition to the standard modules of Node.js, Function Compute provides commonly used modules for Node.js for your reference. The following table lists the common modules that are provided by Function Compute.

Node.js 20 and Node.js 18

Module

Description

Version

co

Control flow

4.6.0

gm

GraphicsMagick

1.25.0

ali-oss

Object Storage Service (OSS) SDK

6.19.0

aliyun-sdk

Alibaba Cloud SDK

1.12.10

alicloud/fc2

Function Compute SDK

2.6.6

tablestore

Tablestore SDK

5.4.1

body

HTTP body parsing library

5.1.0

raw-body

HTTP body parsing library

2.5.2

ali-mns

Message Service (MNS) SDK

2.6.8

alicloud/pop-core

Alibaba Cloud SDK of POP API

1.7.13

Node.js 16

Module

Description

Version

co

Control flow

4.6.0

gm

GraphicsMagick

1.23.1

ali-oss

OSS SDK

6.17.1

aliyun-sdk

Alibaba Cloud SDK

1.12.5

alicloud/fc2

Function Computed SDK

2.6.0

tablestore

Tablestore SDK

5.2.1

body

HTTP body parsing library

5.1.0

raw-body

HTTP body parsing library

2.5.1

ali-mns

MNS SDK

2.6.8

alicloud/pop-core

Alibaba Cloud SDK of POP API

1.7.12

Node.js 14

Module

Description

Version

co

Control flow

4.6.0

gm

GraphicsMagick

1.23.0

ali-oss

OSS SDK

6.6.0

aliyun-sdk

Alibaba Cloud SDK

1.12.3

alicloud/fc2

Function Compute SDK

2.2.0

tablestore

Tablestore SDK

5.0.7

body

HTTP body parsing library

5.1.0

raw-body

HTTP body parsing library

2.4.1

ali-mns

MNS SDK

2.6.8

alicloud/pop-core

Alibaba Cloud SDK of POP API

1.7.9

alicloud/fnf

Workflow SDK

1.1.0

Node.js 12

Module

Description

Version

co

Control flow

4.6.0

gm

GraphicsMagick

1.23.0

ali-oss

OSS SDK

6.6.0

aliyun-sdk

Alibaba Cloud SDK

1.12.3

alicloud/fc2

Function Compute SDK

2.2.0

opencv

OpenCV

7.0.0

tablestore

Tablestore SDK

5.0.7

body

HTTP body parsing library

5.1.0

raw-body

HTTP body parsing library

2.4.1

ali-mns

MNS SDK

2.6.8

alicloud/pop-core

Alibaba Cloud SDK of POP API

1.7.9

alicloud/fnf

Workflow SDK

1.1.0

Node.js 10 and Node.js 8

Module

Description

Version

co

Control flow

4.6.0

gm

GraphicsMagick

1.23.0

ali-oss

OSS SDK

4.10.1

aliyun-sdk

Alibaba Cloud SDK

1.11.0

alicloud/fc2

Function Compute SDK

2.1.0

opencv

OpenCV

6.2.0

tablestore

Tablestore SDK

4.2.0

body

HTTP body parsing library

5.1.0

raw-body

HTTP body parsing library

2.3.2

ali-mns

MNS SDK

2.6.5

alicloud/fnf

Workflow SDK

1.1.0

References