Function Compute menyediakan berbagai waktu proses Node.js.
Runtimes Node.js
Versi berikut ini didukung.
Versi | Pengenal | Sistem operasi | Arsitektur |
Node.js 20.x | nodejs20 | Linux (Debian 10) | x86_64 |
Node.js 18.x | nodejs18 | Linux (Debian 10) | x86_64 |
Node.js 16.x | nodejs16 | Linux (Debian 9) | x86_64 |
Node.js 14.x | nodejs14 | Linux (Debian 9) | x86_64 |
Node.js 12.x | nodejs12 | Linux (Debian 9) | x86_64 |
Waktu proses Node.js 4.4, Node.js 6, Node.js 8.x, dan Node.js 10.x telah mencapai akhir masa pakai (EOL). Untuk informasi selengkapnya, lihat Kebijakan penghentian waktu proses.
Tentukan penanganan fungsi sebagai modul ES
Untuk Node.js 18 dan versi yang lebih baru, Function Compute mendukung modul ECMAScript (ES) dan CommonJS. Versi sebelumnya hanya mendukung modul CommonJS. Secara default, Function Compute memperlakukan file .js sebagai modul CommonJS.
Anda dapat menetapkan kode Anda sebagai modul ES dengan dua cara:
Tentukan
typesebagaimoduledalam filepackage.jsonfungsi Anda. Dalam hal ini, semua file.jsakan diperlakukan sebagai modul ES.Gunakan ekstensi nama file
.mjs. Dalam hal ini, hanya file yang menggunakan ekstensi.mjsyang dianggap sebagai modul ES, sedangkan file.jstetap sebagai modul CommonJS.
Modul yang umum digunakan
Selain modul standar Node.js, Function Compute menyediakan modul populer berikut untuk Node.js yang dapat Anda referensikan.
Node.js 20 dan Node.js 18
Modul | Deskripsi | Versi |
co | 4.6.0 | |
gm | 1.25.0 | |
ali-oss | 6.19.0 | |
aliyun-sdk | 1.12.10 | |
alicloud/fc2 | 2.6.6 | |
tablestore | 5.4.1 | |
body | 5.1.0 | |
raw-body | 2.5.2 | |
ali-mns | 2.6.8 | |
alicloud/pop-core | 1.7.13 |
Node.js 16
Modul | Deskripsi | Versi |
co | 4.6.0 | |
gm | 1.23.1 | |
ali-oss | 6.17.1 | |
aliyun-sdk | 1.12.5 | |
alicloud/fc2 | 2.6.0 | |
tablestore | 5.2.1 | |
body | 5.1.0 | |
raw-body | 2.5.1 | |
ali-mns | 2.6.8 | |
alicloud/pop-core | 1.7.12 |
Node.js 14
Modul | Deskripsi | Versi |
co | 4.6.0 | |
gm | 1.23.0 | |
ali-oss | 6.6.0 | |
aliyun-sdk | 1.12.3 | |
alicloud/fc2 | 2.2.0 | |
tablestore | 5.0.7 | |
body | 5.1.0 | |
raw-body | 2.4.1 | |
ali-mns | 2.6.8 | |
alicloud/pop-core | 1.7.9 | |
alicloud/fnf | 1.1.0 |
Node.js 12
Modul | Deskripsi | Versi |
co | 4.6.0 | |
gm | 1.23.0 | |
ali-oss | 6.6.0 | |
aliyun-sdk | 1.12.3 | |
alicloud/fc2 | 2.2.0 | |
opencv | 7.0.0 | |
tablestore | 5.0.7 | |
body | 5.1.0 | |
raw-body | 2.4.1 | |
ali-mns | 2.6.8 | |
alicloud/pop-core | 1.7.9 | |
alicloud/fnf | 1.1.0 |