# ice-npm-utils

> npm utils for ice

Latest version **3.0.3** (published 2023-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install ice-npm-utils
pnpm add ice-npm-utils
yarn add ice-npm-utils
bun add ice-npm-utils
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2023-05-24 |
| First published | 2019-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 7 |
| Unpacked size | 15 KB |
| Known vulnerabilities | 0 (+35 in 2 direct dependencies) |
| Install scripts | no |
| Maintainers | alvinhui, sobear, oraaange, rax-publisher |

## Links

- npm: https://www.npmjs.com/package/ice-npm-utils
- npm.io page: https://npm.io/package/ice-npm-utils

## Dependencies (7)

- [tar](https://npm.io/package/tar.md) ^6.0.0
- [axios](https://npm.io/package/axios.md) ^0.23.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^1.0.0
- [semver](https://npm.io/package/semver.md) ^7.0.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [url-join](https://npm.io/package/url-join.md) ^4.0.1
- [@appworks/constant](https://npm.io/package/@appworks/constant.md) ^0.1.2

## Recent versions

- 3.0.3 (latest) — 2023-05-24
- 3.1.0-alpha.0 (alpha) — 2026-03-02
- 2.1.3 (release-2) — 2022-03-18
- 3.0.0-2 (beta) — 2021-10-21
- 3.0.2 — 2022-03-16
- 3.0.1 — 2021-11-23
- 3.0.0 — 2021-11-23
- 3.0.0-1 — 2021-10-20
- 3.0.0-0 — 2021-10-19
- 2.1.2 — 2021-07-22
- 2.1.1 — 2021-04-12
- 2.1.0 — 2021-02-22
- 2.0.2 — 2021-02-19
- 2.0.1 — 2020-07-20
- 2.0.1-beta.1 — 2020-07-20
- … 34 more at https://npm.io/package/ice-npm-utils/versions

## README

# ice-npm-utils

some utils for ice.

## Installation

```bash
npm install ice-npm-utils --save-dev
```

## Basic Usage

```js
const { getNpmLatestSemverVersion } = require('ice-npm-utils');
```

## API

### getNpmRegistry(npmName)

Default return `https://registry.npm.taobao.org`

### getUnpkgHost(npmName)

Default return `https://unpkg.com`

### getNpmLatestSemverVersion(npmName, baseVersion)

Return `Promise.resolve(version)`

### getLatestVersion(npmName)

Return `Promise.resolve(version)`

### getVersions(npmName)

Return `Promise.resolve(versions)`

### getSatisfiesVersions(npmName, semverRange)

Return `Promise.resolve(versions)`

### getNpmInfo(npmName)

Return `Promise.resolve(response.data)`

### getNpmClient(npmName)

Default return `npm`

### checkAliInternal()

Return `Promise.resolve(isInternal)`

### getNpmTarball(name, version)

Return `Promise.resolve(tarball)`

### getAndExtractTarball(destDir, tarball, progressFunc: () => {})

Return `Promise.resolve(allFiles: string[])`

## Custom

### Custom Npm Registry

```
process.env.REGISTRY=https://registry.npmjs.org
```

### Custom Unpkg Host

```
process.env.UNPKG=https://unpkg.com
```

### Custom Npm Client

```
process.env.NPM_CLIENT=cnpm
```

---
_Source: https://npm.io/package/ice-npm-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
