commit | 102ad58327a4818005720036a2971a7ade2ee92f | [log] [tgz] |
---|---|---|
author | Raphael von der Grün <raphinesse@gmail.com> | Mon May 14 21:34:30 2018 +0200 |
committer | Raphael von der Grün <raphinesse@gmail.com> | Wed May 16 00:04:47 2018 +0200 |
tree | bcecfafaea2520105230b3f0cd4601f1ae046223 | |
parent | 6a864a3242d4b9340d3968fa19a9c8cba9730881 [diff] |
Rework npm fetch test to make it faster and less involved There was so much wrong with the previous test: - I could not get it to fail, even w/out appending '@latest' in create - It relies on an active network connection and can take over 20s easily - It relies on knowing where fetch will save the downloaded template - It seems to test some kind of cache busting that should probably handled by fetch instead of create anyway The new test inherits only the last downside.
This module is used for creating cordova style projects. It also incudes support for cordova templates. It can fetch templates from npm and git.
:
var create = require('cordova-create'); create(dir, id, name, cfg, extEvents);
dir
- directory where the project will be created. Required. id
- app id. Required (but can be “undefined”). name
- app name. Required (but can be “undefined”). cfg
- extra config to be saved in .cordova/config.json Required (but can be “{}”). extEvents
- An EventEmitter instance that will be used for logging purposes. Required (but can be “undefined”).
An example of cfg which would fetch a cordova template from npm (or git):
var cfg = { lib: { www: { template: true, url: 'cordova-app-hello-world', version: '' } } };