You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 5, 2020. It is now read-only.
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:varEventEmitter=require("events").EventEmitter;// This is good:varevents=require("events");varEventEmitter=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
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.
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.