【发布时间】:2013-03-08 14:37:23
【问题描述】:
我的消费节点代码如下所示:
var helloworld = require('helloworld');
helloworld.sayhello();
使用 Typescript 的优点,我将如何声明导出 sayhello() 函数的模块?
【问题讨论】:
标签: node.js typescript
我的消费节点代码如下所示:
var helloworld = require('helloworld');
helloworld.sayhello();
使用 Typescript 的优点,我将如何声明导出 sayhello() 函数的模块?
【问题讨论】:
标签: node.js typescript
helloworld.ts
export function sayhello() {
console.log('hello, world!');
}
请注意,您不会编写包含 module 的块(文件本身就是模块)。
【讨论】: