# npm mirror (pkg.shecan.ir)

> Mirror of the npm registry (registry.npmjs.org) for npm, pnpm and Yarn.

- Upstream: registry.npmjs.org
- Mirror URL: <https://mirror-npm.pkg.shecan.ir/>
- Clients: npm, pnpm, yarn
- Service status: <https://pkg.shecan.ir/status.json> (key `npm`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/npm/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/npm.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `npm`, mirror `shecan`): <https://audit.shecan.ir/#npm>

## Limitations

- Read-only: npm publish, login and npm audit are not supported; pass --no-audit to avoid audit warnings.
- An existing package-lock.json may still contain resolved URLs that point at registry.npmjs.org.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### npm: temporary (one command or the current shell; nothing saved)

Run

```sh
npm install --no-audit --registry=https://mirror-npm.pkg.shecan.ir/ is-number
```

Verify

```sh
npm view is-number version --registry=https://mirror-npm.pkg.shecan.ir/
```

### npm: persistent (user- or system-wide configuration)

Run

```sh
npm config set registry https://mirror-npm.pkg.shecan.ir/
```

Undo / restore the default

```sh
npm config delete registry
```

### npm, pnpm: project (files inside the project)

Configuration file: `.npmrc`

```ini
registry=https://mirror-npm.pkg.shecan.ir/
```

### pnpm: persistent (user- or system-wide configuration)

Run

```sh
pnpm config set registry https://mirror-npm.pkg.shecan.ir/
```

### pnpm: temporary (one command or the current shell; nothing saved)

Run

```sh
pnpm add is-number --registry=https://mirror-npm.pkg.shecan.ir/
```

### yarn: persistent (user- or system-wide configuration)

Run, Yarn 1 (Classic)

```sh
yarn config set registry https://mirror-npm.pkg.shecan.ir/
```

### yarn: project (files inside the project)

Run, Yarn 2+ (Berry), run inside the project directory

```sh
yarn config set npmRegistryServer https://mirror-npm.pkg.shecan.ir/
```
