npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-debug-tool-wu

v1.1.6

Published

debug-tool for react-native

Downloads

5

Readme

react-native-debug-tool (开发调试工具)

安装

npm install react-native-debug-tool --save

or yarn add react-native-debug-tool

功能点

  • 支持显示设备信息:依赖于 react-native-device-info 基础库
  • 支持显示当前App的Http请求记录
  • 支持显示示当前App的WebView加载记录
  • 支持App连接服务器环境切换

用法

初始化方法:

DebugManager.initDeviceInfo(DeviceInfo)
.initServerUrlMap(serverUrlMap, currentUrl, (baseUrl) => {

})
.initStagingKeyMap(deployKeyMap, currentKey, (currentKey) => {

});

注:初始化方法为非必需方法,如果项目不需要支持【环境切换】与【设备信息查看】功能,可以不调用此方法

// DeviceInfo => react-native-device-info 库的DeviceInfo对象

// serverUrlMap => 连接服务器环境 key value Map集合
   如:new Map([['test001','https://domain-001.net'],['test002','https://domain-002.net']])
   
// serverUrl => 默认连接的服务器环境 如:https://domain-001.net

// baseUrl => 环境切换回调的当前的连接服务器环境

功能1:展示设备信息(只要在初始化的时候传入DeviceInfo对象即可)

功能2:展示当前App的Http请求记录


fetch(url, params).then((response) => {
   DebugManager.appendHttpLogs({url, ...params}, response)
})

功能3:展示当前App的WebView加载记录


<WebView source={{uri: url}}
         onNavigationStateChange={params => {
             DebugManagerDebugManager.appendWebViewLogs(params.url);
         }}
/>

功能4:App连接服务器环境切换(在初始化的时候传入severUrlMap及serverUrl,在回调的时候存在本地供Http使用)

调出调试工具入口:


import RootSibling from 'react-native-root-siblings';

DebugManager.showFloat(RootSibling) //在App内需要的地方调用些方法展示工具入口浮点

// only support react-native-root-siblings 3.x

详细使用方法请参考 示例