I'm new with Typescript and with NodeJS.
For some reason this:
import fs = module("fs")
var fs = "fs";
Are you referencing the
node.d.ts file correctly? If TypeScript doesn't have a reference to the definition file for your import, it'll generate a string for the import instead of the expected code.
For example, I had the following:
import passport = require('passport');
and that was generating:
var passport = "passport";
Turns out I'd forgotten to reference the definition file. Adding a reference at the top of the file solved the problem:
/// <reference path="../../definitions/passport.d.ts" />
Arguably you should spot it easily because the TypeScript compiler would throw an error, but 0.9.x is somewhat bug-ridden and it doesn't always catch everything.