Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using nodejs like module management #101

Open
vontio opened this issue Jan 18, 2013 · 2 comments
Open

using nodejs like module management #101

vontio opened this issue Jan 18, 2013 · 2 comments

Comments

@vontio
Copy link

vontio commented Jan 18, 2013

In nodejs I can create a module using

module.exports = MyModule

and require this in main.js file.

MyModule = require('mymodule')

I use coffeescript to write js,coffeescript will wrap generated code in a function,I don't know how to use module write with coffeescript without nodejs like module management.
testcoffee

@Wu-Hao
Copy link
Contributor

Wu-Hao commented Jan 18, 2013

im no expert in coffee or node.js
but you could try using the minified version of the engine that includes all the files,
then you can add

module.exports.cc = cc;

to the bottom of that minified file

@vontio
Copy link
Author

vontio commented Jan 19, 2013

Hi,I am talking about jsb require like nodejs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants