šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

@react-native/core-cli-utils

Package Overview
Dependencies
Maintainers
2
Versions
462
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-native/core-cli-utils

React Native CLI library for Frameworks to build on

0.79.2
latest
Source
npm
Version published
Weekly downloads
941
-11.48%
Maintainers
2
Weekly downloads
Ā 
Created
Source

@react-native/core-cli-utils

npm package

A collection of utilites to help Frameworks build their React Native CLI tooling. This is not intended to be used directly use users of React Native.

Usage

import { Command } from 'commander';
import cli from '@react-native/core-cli-utils';
import debug from 'debug';

const android = new Command('android');

const frameworkFindsAndroidSrcDir = "...";
const tasks = cli.clean.android(frameworkFindsAndroidSrcDir);
const log = debug('fancy-framework:android');

android
    .command('clean')
    .description(cli.clean.android)
    .action(async () => {
        const log = debug('fancy-framework:android:clean');
        log(`🧹 let me clean your Android caches`);
        // Add other caches your framework needs besides the normal React Native caches
        // here.
        for (const task of tasks) {
            try {
                log(`\t ${task.label}`);
                // See: https://github.com/sindresorhus/execa#lines
                const {stdout} = await task.action({ lines: true })
                log(stdout.join('\n\tGradle: '));
            } catch (e) {
                log(`\t āš ļø whoops: ${e.message}`);
            }
        }
    });

And you'd be using it like this:

$ ./fancy-framework android clean
🧹 let me clean your Android caches
    Gradle: // a bunch of gradle output
    Gradle: ....

Features

  • "@react-native/core-cli-utils/version.js" contains the platform and tooling version requirements for react-native.

Contributing

Changes to this package can be made locally and linked against your app. Please see the Contributing guide.

Keywords

cli-utils

FAQs

Package last updated on 01 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts