facebook/flow — pull request #148 by unknownexception (2014-11-29 13:12:40+00:00)
Title: add node.js fs module declaration

This is converted declaration from https://github.com/borisyankov/DefinitelyTyped/blob/master/node/node.d.ts
1). Currently there is a makefile command `make test`, but other tests could be run only manually (like `node_tests`, `auxiliary_tests` and tests for declarations). Should we consider to add new makefile target? Also, is it possible to connect `flow` repository with CI server like travic-ci / codeship?
2). There is no tests for `lib/*.js`, so I ran it across existing codebase, though this is only part of node API and I'm pretty sure somebody have written their own declarations for node core modules. Is it possible to overwrite system declaration? How we can ensure that all contributed declaration is valid? For example, after updating from 0.1.1 to 0.1.2 I've got this error:
```
/gulp-flowtype/index.js:24:3,61:4: function call
Too few arguments (expected default/rest parameters in function)
/private/var/folders/tp/ffwbqwn51dd1zgb9pb8j4g7w0000gn/T/flow_potomushto/flowlib_825dbe6/lib/node.js:116:24,120:31: function type

/gulp-flowtype/index.js:24:17,61:3: function
This type is incompatible with
/private/var/folders/tp/ffwbqwn51dd1zgb9pb8j4g7w0000gn/T/flow_potomushto/flowlib_825dbe6/lib/node.js:118:15,20: object type
```
That's because the signature of `child_process.exec` was:
```
declare function exec(
command: string,
options?: Object, // TODO: child_process$execOpts,
callback: (error: ?Error, stdout: Buffer, stderr: Buffer) => void
): child_process$ChildProcess;
```
but it didn't work with `exec(command, callback)` because `flow` can't manage Maybe types this way. I've fixed it, but the general problem is here.

Maybe somehow we could run `flow` across `node` simple tests? https://github.com/joyent/node/blob/master/test/simple/test-fs-append-file-sync.js

3). Does it make sense at all to convert and debug other modules manually or better to wait for https://github.com/facebook/flow/issues/72?

Flow is great, we would like to use it for both server and client side, but it requires to contribute system declarations or at least overriding declaration to be independent (or `--no-lib` option https://github.com/facebook/flow/issues/114).