Apache Cordova Fetch Library

Clone this repo:
  1. 08eca74 chore(npm): rebuilt package-lock to v2 (#97) by エリス · 3 weeks ago master
  2. 1b2e2e7 ci: test with Node 16 instead of 15 for already correct version of npm@7 (#94) by Alexis THOMAS · 1 year, 4 months ago
  3. f974d86 Increment package version to 3.0.2-dev by Darryl Pogue · 1 year, 6 months ago
  4. d374bb3 Updated version and RELEASENOTES.md for v3.0.1 by Darryl Pogue · 1 year, 6 months ago 3.0.x draft/3.0.1 rel/3.0.1
  5. 548b684 chore: Update package-lock (#93) by Darryl Pogue · 1 year, 6 months ago

cordova-fetch

NPM

Node CI

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.

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

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

Fetch Parameters

ParameterDescription
specA spec for the package to be installed (anything supported by npm install)
destLocation where to install the package
optsAdditional options (optional)
Fetch Options
OptionDefaultDescription
savefalseAdds 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.

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

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

Uninstall Parameters

ParameterDescription
packageNameName of the package to be uninstalled
destLocation from where to uninstall the package
optsAn Object with additional options
Uninstall Options
OptionDefaultDescription
savefalseRemoves dependency from package.json iff true