Lines Matching refs:template
14 export default async function fetchTemplate(destinationPath: string, template?: string) {
15 if (template && fs.existsSync(path.resolve(template))) {
17 Logger.global.info(`Using local template: ${chalk.bold(path.resolve(template))}.`);
18 await fs.copy(path.resolve(template), destinationPath);
19 } else if (template && isNpmPackage(template)) {
21 Logger.global.info(`Using NPM package as template: ${chalk.bold(template)}`);
22 await pacote.extract(template, destinationPath);
37 function isNpmPackage(template: string) {
39 !template.match(/^\./) && // don't start with .
40 !template.match(/^_/) && // don't start with _
41 template.toLowerCase() === template && // only lowercase