---
id: api/cypress-api/platform
title: Cypress.platform | Cypress Documentation
description: Get the underlying OS name as returned from Node's os.platform() in Cypress.
section: api
source_path: docs/api/cypress-api/platform.mdx
version: 24a73f8a97175663aaffd3b016289fb2a523a4ea
updated_at: '2026-05-14T20:17:33.301Z'
---
# Cypress.platform

`Cypress.platform` returns the underlying OS name, as returned from Node's [`os.platform()`](https://nodejs.org/api/os.html#os_os_platform).

Even though Cypress runs in the browser, it automatically makes this property available for use in your tests.

## Syntax

```
Cypress.platform // 'darwin'
```

## Examples

### Conditionals

```
it('has JSON files', () => {  // if windows do one thing, else do another  const cmd = Cypress.platform === 'win32' ? 'dir *.json' : 'ls *.json'  cy.exec(cmd).its('stdout').should('include', 'package.json')})
```
