2.2.0 • Published 5 months ago

@rnx-kit/tools-react-native v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@rnx-kit/tools-react-native

Build npm version

@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:

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";
CategoryType NameDescription
platformAllPlatformsList of supported react-native platforms.
CategoryFunctionDescription
contextloadContext(projectRoot)Equivalent to calling loadConfig() from @react-native-community/cli, but the result is cached for faster subsequent accesses.
contextloadContextAsync(projectRoot)Equivalent to calling loadConfigAsync() (with fallback to loadConfig()) from @react-native-community/cli, but the result is cached for faster subsequent accesses.
contextresolveCommunityCLI(root, reactNativePath)Finds path to @react-native-community/cli.
metrofindMetroPath(projectRoot)Finds the installation path of Metro.
metrogetMetroVersion(projectRoot)Returns Metro version number.
metrorequireModuleFromMetro(moduleName, fromDir)Imports specified module starting from the installation directory of the currently used metro version.
platformexpandPlatformExtensions(platform, extensions)Returns a list of extensions that should be tried for the target platform in prioritized order.
platformgetAvailablePlatforms(startDir)Returns a map of available React Native platforms. The result is cached.
platformgetAvailablePlatformsUncached(startDir, platformMap)Returns a map of available React Native platforms. The result is NOT cached.
platformgetModuleSuffixes(platform, appendEmpty)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
platformparsePlatform(val)Parse a string to ensure it maps to a valid react-native platform.
platformplatformExtensions(platform)Returns file extensions that can be mapped to the target platform.
platformplatformValues()
platformtryParsePlatform(val)
2.0.3

11 months ago

2.2.0

5 months ago

2.0.2

11 months ago

2.0.4

9 months ago

2.1.0

8 months ago

2.0.1

11 months ago

2.0.0

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago