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

@ailhc/egf-core

v1.2.6

Published

This is the core of EasyGameFramework, which provides the ability to register modules, get module instances, and load subroutine scripts

Downloads

71

Readme

@ailhc/egf-core

简介

EasyGameFramework 的核心模块,用于H5游戏/应用程序的渐进式模块化开发

EasyGameFramework core module for progressive modular development of H5 games/applications

特性

  1. 模块注册、初始化管理机制
  2. 智能提示

Demo

  1. CocosCreator2.4.2 模板
  2. CocosCreator3D 1.2 模板 (ps:使用systemjs+插件模式使用)
  3. CocosCreator3.0 模板 (ps:使用npm方式使用)
  4. Egret 5.3 支持npm的模板
  5. Laya 2.7.1 支持npm的模板

使用

  1. 安装

    通过npm安装 npm install @ailhc/egf-core

    如果支持使用npm模块,则 通过导入npm模块的方式

    import { App } from "@ailhc/egf-core"
    

    如果不支持,则使用dist下的iife格式,声明文件则需要自己整理一下 或者直接复制src下的源码

  2. 基础使用

    export class XXXLoader implements egf.IBootLoader {
        onBoot(app: egf.IApp, bootEnd: egf.BootEndCallback): void {
            app.loadModule(moduleIns,"moduleName");
            bootEnd(true);
        }
    
    }
    
    import { App } from "@ailhc/egf-core"
    const app = new App();
    //启动
    app.bootstrap([new XXXLoader()]);
    //初始化
    app.init();
  3. 智能提示和接口提示

    //智能提示的基础,可以在任意模块文件里进行声明比如
    //ModuleA.ts
    declare global {
        interface IModuleMap {
            moduleAName :IXXXModuleA
        }
    }
    //ModuleB.ts
    declare global {
        interface IModuleMap {
            moduleBName :IXXXModuleB
        }
    }
    
    const app = new App<IModuleMap>();
    //在运行时也可调用,这里的moduleIns可以是任意实例,moduleName可以有智能提示
    app.loadModule(moduleIns,"moduleName");
  4. 全局模块调用

    // 可以将模块实例的字典赋值给全局的对象,比如
    //setModuleMap.ts
    export let m: IModuleMap;
    export function setModuleMap(moduleMap: IModuleMap) {
        m = moduleMap;
    }
    //AppMain.ts
    import { setModuleMap, m } from "./ModuleMap";
    
    setModuleMap(app.moduleMap); 
    
    //在别的逻辑里可以通过
    import { m } from "./ModuleMap";
    //调用模块逻辑
    m.moduleA.doSometing()

CHANGELOG

我在哪?

游戏开发之路有趣但不易,

玩起来才能一直热情洋溢。

关注我, 一起玩转游戏开发!

你的关注是我持续更新的动力~

让我们在这游戏开发的道路上并肩前行

在以下这些渠道可以找到我和我的创作:

公众号搜索:玩转游戏开发

或扫码:

一起讨论技术的 QQ 群: 1103157878

博客主页: https://pgd.vercel.app/

掘金: https://juejin.cn/user/3069492195769469

github: https://github.com/AILHC