Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolai-laevskii committed Oct 9, 2023
1 parent ecfb90c commit cdf9123
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,3 +333,22 @@ toPlatformPath('/foo/bar') // => \foo\bar
// On a Linux runner.
toPlatformPath('\\foo\\bar') // => /foo/bar
```

#### Platform helper

Provides shorthands for getting information about platform action is running on.

```js
import { platform } from '@actions/core'
platform.platform // 'win32'
platform.arch // 'x64'
platform.isWindows // true
platform.isMacOS // false
platform.isLinux // false
const {
name, // Microsoft Windows 11 Enterprise
version, // 10.0.22621
} = await platform.getInfo()
```

0 comments on commit cdf9123

Please sign in to comment.