HaxeFoundation/haxe — pull request #2949 by nadako (2014-05-01 15:51:59+00:00)
Title: [js] support js require

This introduces the `@:jsRequire` meta for extern classes that generates `require` statements, similar to what we've done for python imports. It seems that `require` became pretty standard in JS world as it's most importantly used by node.js as well as web libraries through RequireJS.

Example source:
```haxe
@:jsRequire("fs")
extern class FS {
static function readFileSync(path:String, encoding:String):String;
}

@:jsRequire("http", "Server")
extern class Server {
function new();
}
```

Generated JS:
```js
var FS = require("fs");
var Server = require("http").Server;
```