node.js externs for use with Closure Compiler.
Latest commit ee43199 Aug 24, 2014 @dcodeIO Post-merge
Failed to load latest commit information.
redundant stdio is redundant, namespace url, do not validate contrib Jul 6, 2014
tests stdio is redundant, namespace url, do not validate contrib Jul 6, 2014
NodejsClosureCompilerExterns.png README Mar 8, 2013 Consider this done Mar 10, 2013
assert.js Fix block function type warnings in assert.js Apr 12, 2013
buffer.js Remove @nosideeffects from buffer.Buffer.prototype.copy Apr 13, 2013
child_process.js Make options argument of child_process.fork optional Apr 13, 2013
cluster.js Fix type of cluster Apr 13, 2013
core.js +require.main Aug 24, 2014
crypto.js Update crypto module Apr 13, 2013
domain.js Fix typos in type annotations Apr 13, 2013
events.js The way to completeness... Mar 8, 2013
http.js Replace ServerRequest/ClientResponse with IncomingMessage Apr 13, 2013
net.js Fix typos in type annotations Apr 13, 2013
path.js Fix typo @fileoverfiew -> @fileoverview Apr 12, 2013
process.js Fix capitalization of Array and Object types Apr 13, 2013
punycode.js The way to completeness... Mar 8, 2013
querystring.js Interoperability, more... Mar 6, 2013
url.js stdio is redundant, namespace url, do not validate contrib Jul 6, 2014
util.js Fix the util.inspect contract Mar 6, 2014
vm.js Fix typo @fileoverfiew -> @fileoverview Apr 12, 2013
zlib.js Major reworking of streams Apr 13, 2013

node.js Closure Compiler externs

A collection of node.js externs for use with Closure Compiler / ClosureCompiler.js.

See: Advanced Compilation and Externs for details

Naming convention

  • Externs for core components are all lower case
  • Externs for non-core components begin with an upper case character

Node.js specific annotation

If an extern file refers to a module that's usually loaded through var modulename = require("modulename"), a comment is added on top of the file. For example for the fs module:

 var fs = require('fs');

NOTE: This comment on its own does nothing. But if you stick to the template, that is including the fs module exactly the same way naming it also "fs", the compiler will know how to handle the module and its subcomponents. For example:

// This is bad:
var EventEmitter = require("events").EventEmitter;

// This is good:
var events = require("events");
var EventEmitter = events.EventEmitter;

If a file requires a dependency, it is named in the @fileoverview declaration. You should then include the dependency in your compile step, too.

Testing Build Status

Externs are automatically syntax-validated through a ClosureCompiler.js test run. This does not imply that the extern is complete or does actually represent the underlying API (but it should).

Usage with ClosureCompiler.js

ClosureCompiler.js depends on an npm distribution of this repository. As a result, specifiying --externs=node automatically includes all node.js specific externs in your compile step. If you are using non-core modules, you may still need additional externs for these.



Apache License, Version 2.0 -

This repository is not officially supported by Google, Joyent or individual module authors. If the closure compiler license header is used in a file, it is just there so signal that it is ok to include it in official closure channels. All rights belong to their respective owners.