# core/adapters/package.adapter.ts

> 8 lines of code and 2 definitions.

Tree: Bane's Lab Deploy
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/deploy#file-deploy-core-adapters-package-adapter-ts
Source text: https://banes-lab.com/source/deploy/core/adapters/package.adapter.ts.txt

Listed in [core/adapters](https://banes-lab.com/api/source/deploy/core/adapters.md), before [core/adapters/release.adapter.ts](https://banes-lab.com/source/deploy/core/adapters/release.adapter.ts.md).

## Definitions

- `fetchIndex` (lexical_declaration, line 3, exported)
- `response` (lexical_declaration, line 4, exported)

## Contained in

- [core/adapters](https://banes-lab.com/anatomy/deploy/folder-deploy-core-adapters.md)

## Source

```typescript
import { INDEX_FETCH_FAILED } from "#configuration/strings/nginx.strings";

export const fetchIndex = async function fetchIndex(url: string): Promise<string> {
    const response = await fetch(url);
    if (!response.ok) {
        throw new Error(`${INDEX_FETCH_FAILED}${url} ${String(response.status)}`);
    }
    return response.text();
};
```
