mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-05 20:51:36 -05:00
42 lines
691 B
Markdown
42 lines
691 B
Markdown
# @pnpm/fetcher-base
|
|
|
|
> Types for pnpm-compatible fetchers
|
|
|
|
<!--@shields('npm')-->
|
|
[](https://www.npmjs.com/package/@pnpm/fetcher-base)
|
|
<!--/@-->
|
|
|
|
## Installation
|
|
|
|
```sh
|
|
pnpm add @pnpm/fetcher-base
|
|
```
|
|
|
|
## Usage
|
|
|
|
Here's a template for a fetcher using types from `@pnpm/fetcher-base`:
|
|
|
|
```ts
|
|
import { Resolution } from '@pnpm/resolver-base'
|
|
import {
|
|
FetchOptions,
|
|
FetchResult,
|
|
} from '@pnpm/fetcher-base'
|
|
|
|
export async function demoFetcher (
|
|
resolution: Resolution,
|
|
targetFolder: string,
|
|
opts: FetchOptions,
|
|
): Promise<FetchResult> {
|
|
// ...
|
|
return {
|
|
filesIndex,
|
|
tempLocation,
|
|
}
|
|
}
|
|
```
|
|
|
|
## License
|
|
|
|
MIT
|