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

smallcocosutils

v0.1.0

Published

Utils for cocos2d-html5

Downloads

3

Readme

cocos

A tool to help developers coding cocos2d-html5 easily.

安装

  • 安装nodejs
  • clone cocos到本地,cdcocos根目录,执行npm link .

创建cocos2d-html5项目

cd到工程所要存放的目录下,例如想建工程名为HelloWorld的项目,执行以下命令:

cd the/dir/you/want/to/put/your/project/
cocos init HelloWorld

执行完命令之后,将会在当前文件夹生产一个名为HelloWorld和cocos的文件夹。一个是工程文件夹,一个是引擎文件夹。

添加图片等资源文件

将图片资源放在res目录下,然后cdHelloWorld目录下,执行

cocos genRes

如果没有cd到相应的工程目录下,请在命令后面加上工程相对于当前目录的路径,例如,如果在HelloWorld的父目录下,则执行

cocos genRes HelloWorld

此时,在src/cfg/res.js中,将会生成资源路径的配置文件。注意:文件名要唯一。

安装cocos模块

在工程根目录的cocos.json中的dependencies中加入工程所依赖的模块名称以及版本(目前只为了做demo,故没有进行版本的判断),如:"m1" : "*"。 命令执行规则同genRes,执行:

cocos install

此时,会发现cocos/modules目录中多了一个m1的文件夹。依赖模块安装完成。

添加js代码

src中添加工程代码,test文件夹中添加工程测试代码。然后同上,执行

cocos genJsRes

此时,在src/cfg/jsRes.js中,将会生成js的路径配置文件。生成的对象的命名规则为js_+项目名。注意:文件名要唯一。

进行resCfg配置

此步骤在 https://github.com/SmallAiTT/ModuleDemo 中有详细介绍,就不重复写了。

修改main.js,运行工程。

同上。

发布

执行以下命令进行工程发布,规则通genRes:

cocos publish

注:目前自动创建工程时所需要用到的cocos的core模块以及其他依赖模块(有两个依赖模块:m1, m2,其中m2依赖于m1)都是从我本地的服务器下载的。脚本的相应配置文件都在cocos的nodejs模块cfg/cfg.js中。