# Node.js API compatibility - OS

The `os` module in Node.js provides a set of operating system-related utility methods and properties. It allows developers to interact with the underlying operating system, making it easier to gather system information and perform OS-specific tasks. This module is available in the Azion Runtime through Node.js compatibility, and a typical use case is reading environment details, such as the platform or architecture, from within a function.

The example below shows how to use the `os` module in a function:

```javascript
/**
 * An example of using the Node.js OS API in an Azion Function.
 * Support:
 * - Partially supported (Extended by library `os-browserify`)
 * @module runtime-apis/nodejs/os/main
 * @example
 * // Execute with Azion Bundler:
 * npx edge-functions build
 * npx edge-functions dev
 */
import os from "node:os";

/**
 * An example of using the Node.js OS API in an Azion Function.
 * @param {*} event
 * @returns Promise<Response>
 */
const main = async (event) => {
  return new Promise((resolve, reject) => {
    const platform = os.platform();
    console.log("Platform", platform);
    resolve(new Response(`platform: ${platform}`));
  });
};

export default main;
```

## Related resources

- [Node.js `os` documentation](https://nodejs.org/api/os.html)