satyr/coco

export function

Closed this issue · 4 comments

module.co:

export (x)->

main.co:

fn = require './module.co'
console.log typeof fn

prints object. How do I make this return function type? (like module.exports = (x)->)

How do I mark this as a question?

You have to actually name the export. export a or export foo: bar

Since assigning to module.exports is a Node.js specific feature and doesn't have the DRY problem, we don't offer a sugar for it. Simply do module.exports = -> ....

Got it! Thank you!