Apache Cordova Fetch Library

Clone this repo:
  1. 12de62f chore: increment package version to 4.0.1-dev by Erisu · 7 weeks ago master
  2. f1f9ff3 release(4.0.0): updated release notes & version (fetch-4.0.0) by Erisu · 8 weeks ago 4.0.x 4.0.0 rel/4.0.0
  3. 310e0fb ci: sync codecov-action setup between other repos (#111) by エリス · 10 weeks ago
  4. 8687476 dep!: bump which@3.0.0 (#109) by エリス · 10 weeks ago
  5. 7b86803 dep!: bumped node & npm engine requirment & dependencies w/ package-lock rebuild (#108) by エリス · 10 weeks 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