@react-native-community/cli-tools

  • Version 7.0.1
  • Published
  • 264 kB
  • 9 dependencies
  • MIT license

Install

npm i @react-native-community/cli-tools
yarn add @react-native-community/cli-tools
pnpm add @react-native-community/cli-tools

Overview

Overview not available.

Index

Variables

variable logger

const logger: {
success: (...messages: string[]) => void;
info: (...messages: string[]) => void;
warn: (...messages: string[]) => void;
error: (...messages: string[]) => void;
debug: (...messages: string[]) => void;
log: (...messages: string[]) => void;
setVerbose: (level: boolean) => void;
isVerbose: () => boolean;
disable: () => void;
enable: () => void;
};

    variable NoopLoader

    const NoopLoader: typeof OraNoop;

      Functions

      function fetch

      fetch: (
      url: string | Request,
      options?: FetchOptions
      ) => Promise<{ status: number; data: any; headers: Headers }>;

        function fetchToTemp

        fetchToTemp: (url: string) => Promise<string>;
        • Downloads the given url to the OS's temp folder and returns the path to it.

        function findProjectRoot

        findProjectRoot: (cwd?: any) => string;
        • Finds project root by looking for a closest package.json.

        function getDefaultUserTerminal

        getDefaultUserTerminal: () => string | undefined;

          function getLoader

          getLoader: (options?: string | Options | undefined) => Ora;

            function groupFilesByType

            groupFilesByType: (assets: Array<string>) => any;
            • Given an array of files, it groups it by it's type. Type of the file is inferred from it's mimetype based on the extension file ends up with. The returned value is an object with properties that correspond to the first part of the mimetype, e.g. images will be grouped under image key since the mimetype for them is image/jpg etc.

              Example: Given an array ['fonts/a.ttf', 'images/b.jpg'], the returned object will be: {font: ['fonts/a.ttf'], image: ['images/b.jpg']}

            function hookStdout

            hookStdout: (callback: Function) => () => void;

              function inlineString

              inlineString: (str: string) => string;

                function isPackagerRunning

                isPackagerRunning: (
                packagerPort?: string | number
                ) => Promise<'running' | 'not_running' | 'unrecognized'>;
                • Indicates whether or not the packager is running. It returns a promise that returns one of these possible values: - running: the packager is running - not_running: the packager nor any process is running on the expected port. - unrecognized: one other process is running on the port we expect the packager to be running.

                function launchDebugger

                launchDebugger: (url: string) => Promise<void>;

                  function launchDefaultBrowser

                  launchDefaultBrowser: (url: string) => Promise<void>;

                    function launchEditor

                    launchEditor: (
                    fileName: string,
                    lineNumber: number,
                    projectRoots: ReadonlyArray<string>
                    ) => void;

                      function releaseChecker

                      releaseChecker: (root: string) => Promise<void>;

                        function resolveNodeModuleDir

                        resolveNodeModuleDir: (root: string, packageName: string) => string;
                        • Finds a path inside node_modules

                        Classes

                        class CLIError

                        class CLIError extends Error {}
                        • A custom Error that creates a single-lined message to match current styling inside CLI. Uses original stack trace when originalError is passed or erase the stack if it's not defined.

                        constructor

                        constructor(msg: string, originalError?: string | Error);

                          Type Aliases

                          type Loader

                          type Loader = Ora;

                            Package Files (15)

                            Dependencies (9)

                            Dev Dependencies (4)

                            Peer Dependencies (0)

                            No peer dependencies.

                            Badge

                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@react-native-community/cli-tools.

                            • Markdown
                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@react-native-community/cli-tools)
                            • HTML
                              <a href="https://www.jsdocs.io/package/@react-native-community/cli-tools"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>