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

fireacg-core

v0.0.31

Published

FireACG Core for JavaScript 项目核心创库, 提供 Api 与 Native 进行交互

Readme

FireACG-Core-JavaScript

FireACG Core for JavaScript 项目核心创库, 提供 Api 与 Native 进行交互

Installation

// npm
npm install fireacg-core

// yarn
yarn add fireacg-core

Usage/Examples

请参考: src/__tests__/*.ts

API Reference

emit

App 调用 Native

FireACG.shared().emit(cmd: NativeCommand);
app.emit(cmd: NativeCommand);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | cmd | NativeCommand | true | Native 指令 |

emitHttpRequest

App 调用 Native 完成网络请求, 对 emit 的封装, 方便使用, 直接通过 emit 调用可达到同样的效果

FireACG.shared().emitHttpRequest(appName: string, a: HttpParams | URL, callback: Callback);
app.emitHttpRequest(a: HttpParams | URL, callback: Callback);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | appName | string | true | app 名称 | | a | HttpParams\|URL | true | http 请求参数对象或者 URL 链接对象 | | callback | Callback | true | http 请求完成后的回调方法 |

nativeEmitCallback

app 回调 Native, Native 请求完 app 后, app 响应 Native 的请求, 如果在 app 是直接 return 结果集, 则不需要手动调用改方法

FireACG.shared().nativeEmitCallback(cmd: AppCommand);
app.nativeEmitCallback(cmd: AppCommand);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | cmd | AppCommand | true | App 指令 |

callHandler

Native 调用 app 完成对应指令的业务逻辑

FireACG.shared().callHandler(cmd: AppCommand);
app.callHandler(cmd: AppCommand);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | cmd | AppCommand | true | App 指令 |

emitCallback

Native 回调 app

FireACG.shared().emitCallback(cmd: NativeCommand);
app.emitCallback(cmd: NativeCommand);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | cmd | NativeCommand | true | Native 指令 |


addApp

添加 App, 注册到 Native

FireACG.shared().addApp(name: string, app: App);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | name | string | true | app 名称 | | app | App | true | App 对象 |

log

打印日志, 接管系统的日志打印工作, 以便在 Native 环境下也能正常打印日志

FireACG.shared().log(tag: string, ...args: any[]);
app.log(tag: string, ...args: any[]);

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | tag | string | true | 标记, 方便查找数据 | | ...args | any[] | false | 需要打印的数据 |

parseJson

处理非标准 JSON, 转换为标准 JSON 格式

FireACG.shared().parseJson(str: string): string | null;

| Parameter | Type | Require | Description | | :-------- | :------- | :-------| :------------------------- | | str | string | true | json 字符串 |

FAQ

...