> For the complete documentation index, see [llms.txt](https://zaidlang.gitbook.io/z/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zaidlang.gitbook.io/z/standard-library/os.md).

# OS

Provides common functionality related to the operating system.

### Methods <a href="#methods" id="methods"></a>

#### `os.args()` <a href="#osargs" id="osargs"></a>

Returns a list of command line arguments passed to a Ghost script. The first element `[0]` is the script name.

```go
os.args()
```

#### `os.clock()` <a href="#osclock" id="osclock"></a>

Returns the number of nanoseconds elapsed since January 1, 1970 UTC.

January 1st, 1970 at 00:00:00 UTC is referred to as the Unix epoch. Early Unix engineers picked that date arbitrarily because they needed to set a uniform date for the start of time, and New Year's Day, 1970, seemed most convenient.

```go
os.clock()

// expected value: 1643344902998773000
```

#### `os.exit()` <a href="#osexit" id="osexit"></a>

Causes the current program to exit with the given status code and optional message. Conventionally, code zero indicates success, non-zero an error. The program terminates immediately.

For portability, the status code should be in the range `[0, 125]`.

```go
os.exit(0, "Process completed successfully")

// expected outout: Process completed successfully
```

### Properties <a href="#properties" id="properties"></a>

#### `os.name` <a href="#osname" id="osname"></a>

Returns the name of the current operating system:

* `darwin` (macos)
* `linux`
* `windows`

```go
os.name

// expected value: darwin
```
