Apache Cordova Fetch Library

Clone this repo:
  1. 1b2e2e7 ci: test with Node 16 instead of 15 for already correct version of npm@7 (#94) by Alexis THOMAS · 3 months ago master
  2. f974d86 Increment package version to 3.0.2-dev by Darryl Pogue · 6 months ago
  3. d374bb3 Updated version and RELEASENOTES.md for v3.0.1 by Darryl Pogue · 6 months ago 3.0.x draft/3.0.1 rel/3.0.1
  4. 548b684 chore: Update package-lock (#93) by Darryl Pogue · 6 months ago
  5. d001b88 fix: cordova-fetch with npm@7 (#91) by Raphael von der Grün · 6 months ago



Node CI

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



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.

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


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

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