react-native-init-func

0.0.6 • Public • Published

react-native-init-func

license npm

programmatic React Native initialization function from the CLI

exports the flexible init command function from @react-native-community/cli

usage

sample usage:

const init = require('react-native-init-func')

;(async () => {
  await init(['demo'], { template: 'react-native-tvos@latest' })

  console.log('demo is now ready')
})()

or with a custom relative directory option:

const init = require('react-native-init-func')

;(async () => {
  await init(['demo'], {
    directory: 'react-native-awesome-module/demo',
    template: 'react-native-tvos@latest'
  })

  console.log('react-native-awesome-module/demo is now ready')
})()

major quirk

This function seems to change the process cwd. It is recommended to resolve any relative paths needed before calling this function.

License

MIT LICENSE

Readme

Keywords

none

Package Sidebar

Install

npm i react-native-init-func

Weekly Downloads

456

Version

0.0.6

License

MIT

Unpacked Size

3.37 kB

Total Files

4

Last publish

Collaborators

  • brodybits