Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs

ct.js

Create cool 2D games with a free game editor! · By Cosmo Myzrail Gorynych

Node Module Usage?

A topic by FiredFromLife created 65 days ago Views: 64 Replies: 4
Viewing posts 1 to 2
(1 edit)

Hi, I would really like to include a Node Module in my project. What would be the best way to do this? The include folder?

I understand it would disallow exporting to a browser, but that would be fine for what I'm working on.

Would it be possible in future versions to allow NPM module installation?

Developer

What would be the best way to do this? The include folder?

Probably yes, but if the module is aimed for browsers, better find its already minified, browser-ready file instead. Copying a ton of files of node_modules ain’t a fast task.

Would it be possible in future versions to allow NPM module installation?

In future versions — sure, but not in ct.js’ v1.x

The module is not aimed at browsers, which is the issue.

The first module I wanted, I included very simply with a CDN, which is excellent I can do that!

But the other is a Node Module, not for browsers, would the include folder still work?

I can seem to only find places to put code that is executed in the browser, none that allow access to native Node.

Developer(+1)

v1.2 does not allow running node modules insude debugger (I forgot about that); v1.3 allows, but is not yet released. In both versions, an exported game has node.js enabled.

Anyways, developing a node-enabled game would be a pain in the ass in v1.2, so better wait for v1.3, or build it from sources at github.com/ct-js/ct-js. People have critical errors with it on Ubuntu, though (but works fine on Windows and Fedora)

Awesome:)

Thank you for your quick responses. 

Any release window for 1.3?