A collection of supplemental react-native functions and types
npm install @rnx-kit/tools-react-native

@rnx-kit/tools-react-native is a collection of supplemental react-native
functions and types.
You can import the entire package, or, to save space, import individual
categories:
``typescript
import * as tools from "@rnx-kit/tools-react-native";
// Alternatively...
import * as metroTools from "@rnx-kit/tools-react-native/metro";
import * as platformTools from "@rnx-kit/tools-react-native/platform";
`
| Category | Type Name | Description |
| -------- | ------------ | ----------------------------------------- |
| platform | AllPlatforms | List of supported react-native platforms. |
| Category | Function | Description |
| -------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| context | loadContext(projectRoot) | Equivalent to calling loadConfig() from @react-native-community/cli, but the result is cached for faster subsequent accesses. |loadContextAsync(projectRoot)
| context | | Equivalent to calling loadConfigAsync() (with fallback to loadConfig()) from @react-native-community/cli, but the result is cached for faster subsequent accesses. |resolveCommunityCLI(root, reactNativePath)
| context | | Finds path to @react-native-community/cli. |findMetroPath(projectRoot)
| metro | | Finds the installation path of Metro. |getMetroVersion(projectRoot)
| metro | | Returns Metro version number. |requireModuleFromMetro(moduleName, fromDir)
| metro | | Imports specified module starting from the installation directory of the currently used metro version. |expandPlatformExtensions(platform, extensions)
| platform | | Returns a list of extensions that should be tried for the target platform in prioritized order. |getAvailablePlatforms(startDir)
| platform | | Returns a map of available React Native platforms. The result is cached. |getAvailablePlatformsUncached(startDir, platformMap)
| platform | | Returns a map of available React Native platforms. The result is NOT cached. |getModuleSuffixes(platform, appendEmpty)
| platform | | Get the module suffixes array for a given platform, suitable for use with TypeScript's moduleSuffixes setting in the form of ['.ios', '.native', ''] or ['.windows', '.win', '.native', ''] or similar |parsePlatform(val)
| platform | | Parse a string to ensure it maps to a valid react-native platform. |platformExtensions(platform)
| platform | | Returns file extensions that can be mapped to the target platform. |platformValues()
| platform | | |tryParsePlatform(val)` | |
| platform |