# cordova-fetch

> Apache Cordova fetch module. Fetches from git and npm.

Latest version **5.0.0** (published 2025-08-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install cordova-fetch
pnpm add cordova-fetch
yarn add cordova-fetch
bun add cordova-fetch
```

## Health

**Score 40/100 (D)** — status: stable.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 5.0.0 |
| Published | 2025-08-29 |
| First published | 2016-05-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=20.9.0 |
| Dependencies | 8 |
| Unpacked size | 35.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | Apache Software Foundation |
| Maintainers | brodybits, dpogue, cordovaowner, stevegill, purplecabbage, anis, filmaj, bowserj, shazron, surajpindoria, erisu, niklasmerz, janpio, normanbreau, pvpoyer, kotikov.vladimir, apachebuilds, audreyso |
| Keywords | cordova, fetch, apache, ecosystem:cordova, cordova:tool |

## Links

- npm: https://www.npmjs.com/package/cordova-fetch
- Repository: https://github.com/apache/cordova-fetch
- Homepage: https://github.com/apache/cordova-fetch#readme
- Issues: https://github.com/apache/cordova-fetch/issues
- npm.io page: https://npm.io/package/cordova-fetch

## Dependencies (8)

- [execa](https://npm.io/package/execa.md) ^5.1.1
- [which](https://npm.io/package/which.md) ^5.0.0
- [pacote](https://npm.io/package/pacote.md) ^21.0.0
- [semver](https://npm.io/package/semver.md) ^7.7.2
- [resolve](https://npm.io/package/resolve.md) ^1.22.10
- [cordova-common](https://npm.io/package/cordova-common.md) ^6.0.0
- [npm-package-arg](https://npm.io/package/npm-package-arg.md) ^13.0.0
- [@npmcli/arborist](https://npm.io/package/@npmcli/arborist.md) ^9.1.3

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 5.0.0 (latest) — 2025-08-29
- 5.0.1-nightly.20251125002453809.sha.9e62e08e (nightly) — 2025-11-25
- 5.0.1-nightly.20251124002730161.sha.9e62e08e — 2025-11-24
- 5.0.1-nightly.20251123002925587.sha.9e62e08e — 2025-11-23
- 5.0.1-nightly.20251122002424873.sha.1a65f0bb — 2025-11-22
- 5.0.1-nightly.20251121002528743.sha.1a65f0bb — 2025-11-21
- 5.0.1-nightly.20251120002524063.sha.1a65f0bb — 2025-11-20
- 5.0.1-nightly.20251119002618228.sha.f9f3a7fd — 2025-11-19
- 5.0.1-nightly.20251118002526728.sha.bc3b4f46 — 2025-11-18
- 5.0.1-nightly.20251117002630731.sha.bc3b4f46 — 2025-11-17
- 5.0.1-nightly.20251116002746597.sha.bc3b4f46 — 2025-11-16
- 5.0.1-nightly.20251115002454896.sha.bc3b4f46 — 2025-11-15
- 5.0.1-nightly.20251114002605023.sha.bc3b4f46 — 2025-11-14
- 5.0.1-nightly.20251113002531212.sha.bc3b4f46 — 2025-11-13
- 5.0.1-nightly.20251112002541217.sha.bc3b4f46 — 2025-11-12
- … 2371 more at https://npm.io/package/cordova-fetch/versions

## README

<!--
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#
-->

# cordova-fetch

[![NPM](https://nodei.co/npm/cordova-fetch.svg?style=flat&data=n,v,u&color=blue)](https://www.npmjs.com/package/cordova-fetch)

[![Node CI](https://github.com/apache/cordova-fetch/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/apache/cordova-fetch/actions/workflows/ci.yml?query=branch%3Amaster)
[![Release Audit](https://github.com/apache/cordova-fetch/actions/workflows/release-audit.yml/badge.svg?branch=master)](https://github.com/apache/cordova-fetch/actions/workflows/release-audit.yml?query=branch%3Amaster)
[![codecov.io](https://codecov.io/github/apache/cordova-fetch/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-fetch?branch=master)

This package can be used to install and uninstall Node.js packages using npm.

## Usage

### `fetch`

Installs a module from:

* `npm` registry
* `git` url
* `tarball`
  * url
  * file on local file system
* `folder` path on local system

Returns a `Promise` resolving to the absolute path of the installed package.

```js
const fetch = require('cordova-fetch');

fetch(spec, dest, opts).then(pathToInstalledPackage => {
    // Do something
});
```

#### Fetch Parameters

Parameter | Description
-|-
`spec` | A spec for the package to be installed (anything supported by `npm install`)
`dest` | Location where to install the package
`opts` | Additional options (optional)

##### Fetch Options

Option | Default | Description
-|-|-
`save` | `false` | Adds the package as dependency to `package.json` iff `true`

### `uninstall`

Uninstalls a package from the given directory. Returns a `Promise` that resolves when removal has finished.

```js
const { uninstall } = require('cordova-fetch');

uninstall(packageName, dest, opts).then(() => {
    // Do something
});
```

#### Uninstall Parameters

Parameter | Description
-|-
`packageName` | Name of the package to be uninstalled
`dest` | Location from where to uninstall the package
`opts` | An Object with additional options

##### Uninstall Options

Option | Default | Description
-|-|-
`save` | `false` | Removes dependency from `package.json` iff `true`

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