<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [Singularity](./bitburner.singularity.md) &gt; [purchaseProgram](./bitburner.singularity.purchaseprogram.md)

## Singularity.purchaseProgram() method

Purchase a program from the dark web.

**Signature:**

```typescript
purchaseProgram(programName: ProgramName): boolean;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

programName


</td><td>

[ProgramName](./bitburner.programname.md)


</td><td>

Name of program to purchase.


</td></tr>
</tbody></table>

**Returns:**

boolean

True if the specified program is purchased or if you already own it, and false otherwise.

## Remarks

RAM cost: 2 GB \* 16/4/1

This function allows you to automatically purchase programs. You MUST have a TOR router in order to use this function. The cost of purchasing programs using this function is the same as if you were purchasing them through the Dark Web using the Terminal buy command.

## Example


```js
const programName = ns.enums.ProgramName.bruteSsh;
const success = ns.singularity.purchaseProgram(programName);
if (!success) ns.tprint(`ERROR: Failed to purchase ${programName}`);
```

