Apache Cordova Fetch Library

Clone this repo:
  1. 90ed5ac ci(workflow): update release-audit & license config (#128) by エリス · 3 days ago master
  2. d137bc7 chore(deps-dev): bump brace-expansion from 1.1.11 to 1.1.12 (#124) by dependabot[bot] · 6 weeks ago
  3. 12ee14a chore(deps): bump cross-spawn from 7.0.3 to 7.0.6 (#122) by dependabot[bot] · 8 months ago
  4. 3ed8ff2 chore(ci): Add licence checker workflow (#123) by Darryl Pogue · 8 months ago
  5. 3b15497 chore(ci): Fix dependabot code scanning errors (#121) by Darryl Pogue · 9 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