code: async function createFromRemoteTemplate(
    template: string,
    destPath: string,
    newProjectName: string,
    destinationRoot: string,
  ) {
    let installPackage;
    let templateName;
    if (template.includes(':/')) {
      // URL, e.g. git://, file://, file:/
      installPackage = template;
      templateName = template.substr(template.lastIndexOf('/') + 1);
    } else {
      // e.g 'demo'
      installPackage = `react-native-template-${template}`;
      templateName = installPackage;
    }
  
    // Check if the template exists
    logger.info(`Fetching template ${installPackage}...`);
    try {
      await PackageManager.install([installPackage]);
      const templatePath = path.resolve('node_modules', templateName);
      copyProjectTemplateAndReplace(templatePath, destPath, newProjectName, {
        // Every template contains a dummy package.json file included
        // only for publishing the template to npm.
        // We want to ignore this dummy file, otherwise it would overwrite
        // our project's package.json file.
        ignorePaths: [
          'package.json',
          'dependencies.json',
          'devDependencies.json',
        ],
      });
      await installTemplateDependencies(templatePath, destinationRoot);
      await installTemplateDevDependencies(templatePath, destinationRoot);
    } finally {
      // Clean up the temp files
      try {
        await PackageManager.uninstall([templateName]);
      } catch (err) {
        // Not critical but we still want people to know and report
        // if this the clean up fails.
        logger.warn(
          `Failed to clean up template temp files in node_modules/${templateName}. ` +
            'This is not a critical error, you can work on your app.',
        );
      }
    }
  }
docs: The following formats are supported for the template:
  - 'demo' -> Fetch the package react-native-template-demo from npm
  - git://..., http://..., file://... or any other URL supported by npm