function init(projectDir, argsOrName) {
  console.log('Setting up new React Native app in ' + projectDir);
  var env = yeoman.createEnv(
    undefined,
    undefined,
    new CreateSuppressingTerminalAdapter()
  );

  env.register(
    require.resolve(path.join(__dirname, 'generator')),
    'react:app'
  );

  // argv is for instance
  // ['node', 'react-native', 'init', 'AwesomeApp', '--verbose']
  // args should be ['AwesomeApp', '--verbose']
  var args = Array.isArray(argsOrName)
    ? argsOrName
    : [argsOrName].concat(process.argv.slice(4));

  var generator = env.create('react:app', {args: args});
  generator.destinationRoot(projectDir);
  generator.run();
}
/**
 * Creates the template for a React Native project given the provided
 * parameters:
 *   - projectDir: templates will be copied here.
 *   - argsOrName: project name or full list of custom arguments to pass to the
 *                 generator.
 */
Creates the template for a React Native project given the provided
parameters:
- projectDir: templates will be copied here.
- argsOrName: project name or full list of custom arguments to pass to the
generator.
Creates the template for a React Native project given the provided parameters : - projectDir : templates will be copied here . - argsOrName : project name or full list of custom arguments to pass to the generator .
function init(projectDir, argsOrName) {
  console.log('Setting up new React Native app in ' + projectDir);
  var env = yeoman.createEnv(
    undefined,
    undefined,
    new CreateSuppressingTerminalAdapter()
  );
  env.register(
    require.resolve(path.join(__dirname, 'generator')),
    'react:app'
  );
  var args = Array.isArray(argsOrName)
    ? argsOrName
    : [argsOrName].concat(process.argv.slice(4));
  var generator = env.create('react:app', {args: args});
  generator.destinationRoot(projectDir);
  generator.run();
}
function init ( projectDir , argsOrName ) { console . log ( 'Setting up new React Native app in ' + projectDir ) ; var env = yeoman . createEnv ( undefined , undefined , new CreateSuppressingTerminalAdapter ( ) ) ; env . register ( require . resolve ( path . join ( __dirname , 'generator' ) ) , 'react:app' ) ; var args = Array . isArray ( argsOrName ) ? argsOrName : [ argsOrName ] . concat ( process . argv . slice ( 4 ) ) ; var generator = env . create ( 'react:app' , { args : args } ) ; generator . destinationRoot ( projectDir ) ; generator . run ( ) ; }
Creates the template for a React Native project given the provided
 parameters:
   - projectDir: templates will be copied here.
Creates the template for a React Native project given the provided parameters : - projectDir : templates will be copied here .
// argv is for instance // ['node', 'react-native', 'init', 'AwesomeApp', '--verbose'] // args should be ['AwesomeApp', '--verbose']