Files
bitburner-src/markdown/bitburner.ns.getserver.md
T

63 lines
998 B
Markdown

<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [NS](./bitburner.ns.md) &gt; [getServer](./bitburner.ns.getserver.md)
## NS.getServer() method
Returns data of a server.
If the server is a darknet server, it will also contain the "isOnline" field. If the darknet server has recently gone offline, the returned object will be a dummy server object with `isOnline: false`<!-- -->.
**Signature:**
```typescript
getServer(host?: string): Server & { isOnline?: boolean };
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
host
</td><td>
string
</td><td>
_(Optional)_ Optional. Hostname/IP of the server. Defaults to the hostname of the running script's server.
</td></tr>
</tbody></table>
**Returns:**
[Server](./bitburner.server.md) &amp; { isOnline?: boolean }
Data of the server.
## Remarks
RAM cost: 2 GB