Better Node.JS support

Topics: General, Language Specification
Oct 9, 2012 at 11:43 PM
Edited Oct 9, 2012 at 11:49 PM

Hi,

It seems that Node.JS bits are there, but severely crippled. It'd be great to see some changes in that area;

  • Ability to require("xxx.ts") files from javascript. (I created a module for this though: https://github.com/eknkc/typescript-require)
  • Exporting TypeScriptCompiler as a CommonJS module in Node.JS
  • REPL!
  • A better compiler cli. Say, I want to compile my scripts down into another folder, there is no such option. Or I just want to eval some argument. You should go ahead and copy CoffeeScript cli completely.
  • A sane compiler interface. Let me pass some TS source into a function and receive javascript. Don't make me create weird file writers and manually resolve dependencies on disk and shit like that. If I wanted to write C#, I would.

Overall, I love love the language, it's plain great. Just keep node community happy :)

Oct 9, 2012 at 11:44 PM
Edited Oct 9, 2012 at 11:45 PM

BTW, do you accept pull request if I were to work on some patches? I really don't know how open source is a Microsoft Open Source project.

And, do you have an official Github mirror?

Oct 10, 2012 at 4:10 AM

I am not sure what the TypeScipt team is intending to do with the node.js definitions.

They certainly don't intend them to be the finished state at this moment - that is why they are in the Samples folder. For example their jQuery UI .d.ts file covers just Draggable and Droppable components etc.

I am working on some definitions for TypeScript here:

https://github.com/borisyankov/DefinitelyTyped

I also have copied their definitions in the repo, if you do changes, your pull requests are welcome there.

Oct 13, 2012 at 2:33 AM

@borisyankov
See also https://github.com/soywiz/typescript-node-definitions