Apache Cordova Fetch Library

Clone this repo:
  1. f974d86 Increment package version to 3.0.2-dev by Darryl Pogue · 3 months ago master
  2. d374bb3 Updated version and RELEASENOTES.md for v3.0.1 by Darryl Pogue · 3 months ago 3.0.x draft/3.0.1 rel/3.0.1
  3. 548b684 chore: Update package-lock (#93) by Darryl Pogue · 3 months ago
  4. d001b88 fix: cordova-fetch with npm@7 (#91) by Raphael von der Grün · 3 months ago
  5. 1d96eae refactor: use async/await where applicable (#89) by Raphael von der Grün · 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

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.

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