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 🙏

© 2026 – Pkg Stats / Ryan Hefner

rn-file-opener

v0.0.6

Published

Open file with its default application, clone from https://github.com/huangzuizui/react-native-file-opener

Readme

使用

......

componentDidMount() { DeviceEventEmitter.addListener('inited', (e: Event) => { // handle event. this.setState({ initState: "已经初始化!" + JSON.stringify(e) }) });

DeviceEventEmitter.addListener('onToken', (e: Event) => {
  // handle event.
  this.setState({
    tokenState: "Token信息:" + JSON.stringify(e)
  })
});

DeviceEventEmitter.addListener('pushMsg', (e: Event) => {
  // handle event.
  this.setState({
    messageInfo: "message信息:" + JSON.stringify(e)
  })
});

DeviceEventEmitter.addListener('pushState', (e: Event) => {
  // handle event.
  this.setState({
    pushState: "pushState改变:" + JSON.stringify(e)
  })
});

DeviceEventEmitter.addListener('debug', (e: Event) => {
  // handle event.
  this.setState({
    debug: "debug信息:" + JSON.stringify(e)
  })
});

FileOpener.notifyJSDidLoad((d) => {
  // alert("服务器返回" + d);
})

}

关于PUSH的额外说明

  • 非华为小米的Android和所有iOS的PUSH,走极光通道
    • 调用华为小米的PUSH消息API,发送的消息类型为自定义消息类型(PUSH带action的)
    • 华为小米的appID和Key信息再gradle文件里查找配置com.mi.appid等
    • Android 的MainActivity加如下代码:

关于热更新的代码

  • Android 部分主要代码如下

private static final String bundleFile = "index.android.bundle";

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { ...... @Nullable @Override protected String getJSBundleFile() { String path = String.format("%s%s%s",Environment.getDataDirectory() , File.separator ,bundleFile); if(new File(path).exists()){ return path; } return super.getJSBundleFile(); }

    @Override
    protected String getBundleAssetName(){
        return bundleFile;
    }

  • iOS 部分主要代码如下

RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"app_name" initialProperties:nil launchOptions:launchOptions];

关于升级

Android 升级

  • appName应用名称、
  • releaseNode 更新说明、
  • url 升级地址、
  • cancelable 是否可以取消(强制升级使用)

iOS 升级

  • 使用Link直接打开浏览器升级,如果直接升级,浏览器地址就对应下载的plist文件地址