node:os
The node:os module in Azion Runtime: the values its functions return inside a function, and a sample that reads the platform name.
The node:os module provides operating system utility functions and properties, as the Node.js os documentation describes. In Azion Runtime, import os from "node:os" builds, and every member listed below works without throwing, in a deployed function and under azion dev.
The values are the same in both environments, so they do not identify the machine that runs your code. os.platform() returns linux and os.type() returns Linux. os.homedir() returns /, os.tmpdir() returns /tmp, os.endianness() returns LE, and os.EOL is \n. os.arch(), os.release(), os.hostname(), os.machine(), and os.version() return an empty string, and os.totalmem(), os.freemem(), and os.uptime() return 0. os.availableParallelism() returns 8, os.cpus() returns 8 entries, and os.networkInterfaces() lists one interface, lo0.
Example
The function below reads the platform name, logs it, and returns it in the response body:
The function logs Platform linux and responds with this body: