1.72 GB
20,066 files
Updated 2 months ago
Name
Size
LICENSE11.4 kB
xet
README.md3.07 kB
xet
buffer.js9.69 kB
xet
child_process.js3.13 kB
xet
cluster.js2.19 kB
xet
core.js1.57 kB
xet
dgram.js2.5 kB
xet
dns.js3.89 kB
xet
domain.js1.92 kB
xet
events.js2.44 kB
xet
fs.js12.5 kB
xet
http.js4.79 kB
xet
https.js2.27 kB
xet
net.js4.4 kB
xet
os.js2.08 kB
xet
path.js1.74 kB
xet
process.js2.7 kB
xet
punycode.js1.69 kB
xet
querystring.js1.67 kB
xet
readline.js1.98 kB
xet
readme.txt80 Bytes
xet
repl.js1.47 kB
xet
stream.js4.97 kB
xet
string_decoder.js1.53 kB
xet
tls.js3.68 kB
xet
tty.js1.56 kB
xet
url.js1.84 kB
xet
util.js2.54 kB
xet
vm.js1.96 kB
xet
zlib.js5.58 kB
xet
README.md

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:

/**
 BEGIN_NODE_INCLUDE
 var fs = require('fs');
 END_NODE_INCLUDE
 */

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.

Downloads

License

Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html

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.

Total size
1.72 GB
Files
20,066
Last updated
May 12
Pre-warmed CDN
US EU US EU

Contributors