packages/browser-sync/lib/browser-sync.js
function tasksComplete(bs) {
    return function(err) {
        if (err) {
            bs.logger.setOnce("useLevelPrefixes", true).error(err.message);
        }

        /**
         * Set active flag
         */
        bs.active = true;

        /**
         * @deprecated
         */
        bs.events.emit("init", bs);

        /**
         * This is no-longer needed as the Callback now only resolves
         * when everything (including slow things, like the tunnel) is ready.
         * It's here purely for backwards compatibility.
         * @deprecated
         */
        bs.events.emit("service:running", {
            options: bs.options,
            baseDir: bs.options.getIn(["server", "baseDir"]),
            type: bs.options.get("mode"),
            port: bs.options.get("port"),
            url: bs.options.getIn(["urls", "local"]),
            urls: bs.options.get("urls").toJS(),
            tunnel: bs.options.getIn(["urls", "tunnel"])
        });

        /**
         * Call any option-provided callbacks
         */
        bs.callback("ready", null, bs);

        /**
         * Finally, call the user-provided callback given as last arg
         */
        bs.cb(null, bs);
    };
}
function tasksComplete(bs) {
    return function(err) {
        if (err) {
            bs.logger.setOnce("useLevelPrefixes", true).error(err.message);
        }

        /**
         * Set active flag
         */
        bs.active = true;

        /**
         * @deprecated
         */
        bs.events.emit("init", bs);

        /**
         * This is no-longer needed as the Callback now only resolves
         * when everything (including slow things, like the tunnel) is ready.
         * It's here purely for backwards compatibility.
         * @deprecated
         */
        bs.events.emit("service:running", {
            options: bs.options,
            baseDir: bs.options.getIn(["server", "baseDir"]),
            type: bs.options.get("mode"),
            port: bs.options.get("port"),
            url: bs.options.getIn(["urls", "local"]),
            urls: bs.options.get("urls").toJS(),
            tunnel: bs.options.getIn(["urls", "tunnel"])
        });

        /**
         * Call any option-provided callbacks
         */
        bs.callback("ready", null, bs);

        /**
         * Finally, call the user-provided callback given as last arg
         */
        bs.cb(null, bs);
    };
}
function tasksComplete ( bs ) { return function ( err ) { if ( err ) { bs . logger . setOnce ( "useLevelPrefixes" , true ) . error ( err . message ) ; } /**
         * Set active flag
         */ bs . active = true ; /**
         * @deprecated
         */ bs . events . emit ( "init" , bs ) ; /**
         * This is no-longer needed as the Callback now only resolves
         * when everything (including slow things, like the tunnel) is ready.
         * It's here purely for backwards compatibility.
         * @deprecated
         */ bs . events . emit ( "service:running" , { options : bs . options , baseDir : bs . options . getIn ( [ "server" , "baseDir" ] ) , type : bs . options . get ( "mode" ) , port : bs . options . get ( "port" ) , url : bs . options . getIn ( [ "urls" , "local" ] ) , urls : bs . options . get ( "urls" ) . toJS ( ) , tunnel : bs . options . getIn ( [ "urls" , "tunnel" ] ) } ) ; /**
         * Call any option-provided callbacks
         */ bs . callback ( "ready" , null , bs ) ; /**
         * Finally, call the user-provided callback given as last arg
         */ bs . cb ( null , bs ) ; } ; }
At this point, ALL async tasks have completed
@param {BrowserSync} bs
@returns {Function}
At this point ALL async tasks have completed