@tkc-fe/react-native-navigation-crawler
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published
INTERNAL DEVELOPER GUIDE

React Native Navigation Crawler

Introduction

This package will crawl react native packages looking for screens - it will then optionally output a simple HTML site that will allow you to see the different screens relations and open files directly.

Usage

npx @tkc-fe/react-native-navigation-crawler <route-input> <html-output>

Usage Example

npx @tkc-fe/react-native-navigation-crawler ./src/stacks/Drawer.tsx ./crawl-output

Installation

yarn add @tkc-fe/react-native-navigation-crawler or npm i @tkc-fe/react-native-navigation-crawler

Example 📕


import ReactRouteCrawler from '@tkc-fe/react-native-navigation-crawler'

const crawler = new ReactRouteCrawler()
const screens = crawler.getComponentScreens(
    './src/stacks/RootStack.tsx',   // The route to map screens within.
    true                            // If we should do this recursively.
)                           

Config ⚙️


// You can also pass different optional paraments for the crawlers setup.
const crawler = new ReactRouteCrawler({
    configPath:         './tsconfig.json',      // The location of the tsconfig -- Default: ./tsconfig.json
    sourceFilesGlob:    './src/**/*.tsx'        // The glob pattern for files   -- Default: ./src/**/*.tsx
})

Readme

Keywords

none

Package Sidebar

Install

npm i @tkc-fe/react-native-navigation-crawler

Weekly Downloads

9

Version

0.0.4

License

none

Unpacked Size

4.75 MB

Total Files

19

Last publish

Collaborators

  • sampoate
  • deanhet