2022-10-21 17:16:00 +02:00
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home ](./index.md ) > [bitburner ](./bitburner.md ) > [Hacknet ](./bitburner.hacknet.md ) > [purchaseNode ](./bitburner.hacknet.purchasenode.md )
## Hacknet.purchaseNode() method
Purchase a new hacknet node.
2023-02-11 19:18:50 +01:00
**Signature:**
2022-10-21 17:16:00 +02:00
```typescript
purchaseNode(): number;
```
2023-02-11 19:18:50 +01:00
**Returns:**
2022-10-21 17:16:00 +02:00
number
The index of the Hacknet Node or if the player cannot afford to purchase a new Hacknet Node the function will return -1.
## Remarks
RAM cost: 0 GB
2023-10-03 02:14:44 +02:00
Purchases a new Hacknet Node. Returns a number with the index of the Hacknet Node. This index is equivalent to the number at the end of the Hacknet Node’ s name (e.g. The Hacknet Node named `hacknet-node-4` will have an index of 4).
2022-10-21 17:16:00 +02:00
If the player cannot afford to purchase a new Hacknet Node then the function will return -1.