bin/lmd_builder.js
function (configFile, options) {
    DataStream.call(this);
    this.options = options || {};
    var self = this;

    // apply config
    this.configFile = configFile;

    this.init();

    // Bundles streams
    this.bundles = {};

    // Let return instance before build
    this.buildConfig = this.compileConfig(configFile, self.options);

    this.makeEmptyStreamsUnreadable(this.buildConfig);

    var isFatalErrors = !this.isAllModulesExists(this.buildConfig);
    if (isFatalErrors) {
        this.readable = false;
        this.style.readable = false;
        this.sourceMap.readable = false;
    } else {
        this._initBundlesStreams(this.buildConfig.bundles);
    }
    process.nextTick(function () {
        if (!isFatalErrors) {
            if (configFile) {
                var buildResult = self.build(self.buildConfig);

                self.write(buildResult.source);
                self.style.write(buildResult.style);
                self.sourceMap.write(buildResult.sourceMap.toString());
                self._streamBundles(buildResult.bundles);
            } else {
                self.log.write('lmd usage:\n\t    ' + 'lmd'.blue + ' ' + 'config.lmd.js(on)'.green + ' [output.lmd.js]\n');
            }
        } else {
            self.printFatalErrors(self.buildConfig);
        }
        self.closeStreams();
    });
}
function (configFile, options) {
    DataStream.call(this);
    this.options = options || {};
    var self = this;

    // apply config
    this.configFile = configFile;

    this.init();

    // Bundles streams
    this.bundles = {};

    // Let return instance before build
    this.buildConfig = this.compileConfig(configFile, self.options);

    this.makeEmptyStreamsUnreadable(this.buildConfig);

    var isFatalErrors = !this.isAllModulesExists(this.buildConfig);
    if (isFatalErrors) {
        this.readable = false;
        this.style.readable = false;
        this.sourceMap.readable = false;
    } else {
        this._initBundlesStreams(this.buildConfig.bundles);
    }
    process.nextTick(function () {
        if (!isFatalErrors) {
            if (configFile) {
                var buildResult = self.build(self.buildConfig);

                self.write(buildResult.source);
                self.style.write(buildResult.style);
                self.sourceMap.write(buildResult.sourceMap.toString());
                self._streamBundles(buildResult.bundles);
            } else {
                self.log.write('lmd usage:\n\t    ' + 'lmd'.blue + ' ' + 'config.lmd.js(on)'.green + ' [output.lmd.js]\n');
            }
        } else {
            self.printFatalErrors(self.buildConfig);
        }
        self.closeStreams();
    });
}
function ( configFile , options ) { DataStream . call ( this ) ; this . options = options || { } ; var self = this ; // apply config this . configFile = configFile ; this . init ( ) ; // Bundles streams this . bundles = { } ; // Let return instance before build this . buildConfig = this . compileConfig ( configFile , self . options ) ; this . makeEmptyStreamsUnreadable ( this . buildConfig ) ; var isFatalErrors = ! this . isAllModulesExists ( this . buildConfig ) ; if ( isFatalErrors ) { this . readable = false ; this . style . readable = false ; this . sourceMap . readable = false ; } else { this . _initBundlesStreams ( this . buildConfig . bundles ) ; } process . nextTick ( function ( ) { if ( ! isFatalErrors ) { if ( configFile ) { var buildResult = self . build ( self . buildConfig ) ; self . write ( buildResult . source ) ; self . style . write ( buildResult . style ) ; self . sourceMap . write ( buildResult . sourceMap . toString ( ) ) ; self . _streamBundles ( buildResult . bundles ) ; } else { self . log . write ( 'lmd usage:\n\t    ' + 'lmd' . blue + ' ' + 'config.lmd.js(on)' . green + ' [output.lmd.js]\n' ) ; } } else { self . printFatalErrors ( self . buildConfig ) ; } self . closeStreams ( ) ; } ) ; }
LmdBuilder LMD Package Builder

LmdBuilder is readable stream

@constructor

@inherits Stream

@param {String} configFile
@param {Object} [options]

@example

new LmdBuilder("config.json", {
warn: true
})
.pipe(process.stdout);
LmdBuilder LMD Package Builder