Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brodycj/react-native-init-func
https://github.com/brodycj/react-native-init-func
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/brodycj/react-native-init-func
- Owner: brodycj
- License: mit
- Created: 2020-07-02T18:36:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-18T17:20:40.000Z (6 months ago)
- Last Synced: 2024-08-14T21:39:20.853Z (5 months ago)
- Language: JavaScript
- Size: 12.7 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# react-native-init-func
[![license](https://img.shields.io/github/license/brodybits/react-native-init-func?style=flat-square)](./LICENSE.md)
[![npm](https://img.shields.io/npm/v/react-native-init-func?style=flat-square)](https://www.npmjs.com/package/react-native-init-func)programmatic React Native initialization function from the CLI
exports the flexible `init` command function from `@react-native-community/cli`
## usage
sample usage:
```js
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:
```js
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](./LICENSE.md)