Work around npm bug when uninstalling old cordova platforms (#78)

When using `npm@>=6.11.0` on Windows, `npm uninstall`
of `cordova-android@5.1.1` will leave an empty folder
`node_modules/cordova-android/node_modules` behind. This causes one of
our tests to fail but it is very likely an issue with npm. Furthermore
this is very unlikely to affect users of `cordova-fetch` in production.
1 file changed
tree: 29112844c65757162685ac8d8c6ea145e54ec80f
  1. .github/
  2. spec/
  3. .eslintrc.yml
  4. .gitignore
  5. .ratignore
  6. .travis.yml
  7. appveyor.yml
  8. index.js
  9. package.json
  10. README.md
  11. RELEASENOTES.md
README.md

NPM

cordova-fetch Travis Badge AppVeyor Badge

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

Usage

fetch

Installs a module from npm, a git url or the local file system. Returns a Promise resolving to the absolute path to the installed package.

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

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

Parameters

ParameterDescription
specA spec for the package to be installed (anything supported by npm install)
destLocation where to install the package
optsAdditional options (optional)
Options
OptionDefaultDescription
savefalseAdds the package as dependency to package.json iff true

uninstall

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

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

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

Parameters

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