commit | 307638d63604eb283b581c01a2e702ce39249473 | [log] [tgz] |
---|---|---|
author | Raphael von der GrĂ¼n <raphinesse@gmail.com> | Tue Jun 12 22:11:40 2018 +0200 |
committer | GitHub <noreply@github.com> | Tue Jun 12 22:11:40 2018 +0200 |
tree | b27f7b2bd533f8870781bdc6b1039c63fd6c2aa2 | |
parent | 2d281adfd73dc2cbe5f92589f989d8aa2b1894f2 [diff] |
Simplify installation location retrieval (#18) This replaces the whole existing logic to determine the path of an installed package with a new one. Instead of a lot of guessing we now read the output of npm. Unfortunately we have to parse the human readable output since the information we need (which package was just installed) is not reliably extractable from the output generated when passing --json or --parseable. Apart from a tremendous simplification of the existing code, with this change we now transparently support all spec formats that npm supports too. The removal of getPath is a possibly breaking change. The function was neither documented nor used in any apache/cordova-* repositories though. This supports all npm versions from 6 down to 3 (which are all that are bundled with supported node versions).
This module is used for fetching modules from npm and gitURLs. It fetches the modules via npm install
. It can also npm uninstall
modules from a project.
var fetch = require('cordova-fetch'); fetch(spec, dest, opts);
spec
can be a string containg a npm packageID
or a git URL
. dest
is string of the directory location you wish to npm install
these modules. opts
is an Object of options cordova fetch handles. Currently, fetch only support the save
option. eg. {'save':true}
var npmUninstall = require('cordova-fetch').uninstall; npmUninstall(spec, dest, opts);
spec
can be a string containg a npm packageID
. dest
is string of the directory location you wish to npm uninstall
these modules. opts
is an Object of options cordova fetch handles. Currently, fetch only support the save
option. eg. {'save':true}