Git Product home page Git Product logo

node.js-closure-compiler-externs's Introduction

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.

node.js-closure-compiler-externs's People

Contributors

dcodeio avatar keunwoo avatar kevinoid avatar nicks avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.