开源软件名称(OpenSource Name):frostney/react-native-create-library开源软件地址(OpenSource Url):https://github.com/frostney/react-native-create-library开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):react-native-create-libraryTool to create a React Native library with a single command. Why might you need this?If you are looking to create a native module for React Native, you need some native code for each platform you want to support and then some JavaScript code to bind it all together. Setting this up by yourself can be time-consuming. This is where this tool comes in. It creates a boilerplate with all current best practices in mind.
Why not use Caution: This only creates native modules without a view component. AlternativesInstallationRequirements: Node 6.0+
Command-line usageNavigate into an empty directory to execute the command.
This will create the folder Now install dependencies by running this command in the newly created library.
Programmatic usageconst createLibrary = require('react-native-create-library');
createLibrary({
name: 'MyFancyLibrary'
}).then(() => {
console.log('Oh yay! My library has been created!');
}) Options{
name: String, /* The name of the library (Default: Library) */
prefix: String, /* The prefix for the library (Default: RN) */
modulePrefix: String, /* The module prefix for the library (Default: react-native) */
platforms: Array, /* Platforms the library will be created for. (Default: ['ios', 'android', 'windows']) */
packageIdentifier: String, /* (Android only!) The package name for the Android module (Default: com.reactlibrary) */
namespace: String, /* (Windows only!) The namespace for the Windows module (Default: The package identifier as PascalCase, which is `Com.Reactlibrary`) */
githubAccount: String, /* The github account where the library is hosted (Default: `github_account`) */
authorName: String, /* The author's name (Default: `Your Name`) */
authorEmail: String, /* The author's email (Default: `yourname@email.com`) */
license: String, /* The license type of this library (Default: `Apache-2.0`) */
generateExample: Boolean, /* Will generate a RN example project and link the new library to it (Default: `false`) */
} Acknowledgements
LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论